skip not finished tests and add restore unit tests
This commit is contained in:
parent
873bb31cfa
commit
06ceb66089
14 changed files with 82 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
|||
using Microsoft.DotNet.Tools.Build;
|
||||
using Microsoft.DotNet.Tools.Restore;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
using System;
|
||||
|
@ -7,29 +7,31 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
{
|
||||
public class GivenDotnetRestoreInvocation
|
||||
{
|
||||
const string ExpectedPrefix = "exec <msbuildpath> /m /v:m /NoLogo /t:Restore /ConsoleLoggerParameters:Verbosity=Minimal";
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, @"exec <msbuildpath> /m /v:m /t:Build /clp:Summary")]
|
||||
[InlineData(new string[] { "-o", "foo" }, @"exec <msbuildpath> /m /v:m /t:Build /p:OutputPath=foo /clp:Summary")]
|
||||
[InlineData(new string[] { "--output", "foo" }, @"exec <msbuildpath> /m /v:m /t:Build /p:OutputPath=foo /clp:Summary")]
|
||||
[InlineData(new string[] { "-o", "foo1 foo2" }, @"exec <msbuildpath> /m /v:m /t:Build ""/p:OutputPath=foo1 foo2"" /clp:Summary")]
|
||||
[InlineData(new string[] { "--no-incremental" }, @"exec <msbuildpath> /m /v:m /t:Rebuild /clp:Summary")]
|
||||
[InlineData(new string[] { "-f", "framework" }, @"exec <msbuildpath> /m /v:m /t:Build /p:TargetFramework=framework /clp:Summary")]
|
||||
[InlineData(new string[] { "--framework", "framework" }, @"exec <msbuildpath> /m /v:m /t:Build /p:TargetFramework=framework /clp:Summary")]
|
||||
[InlineData(new string[] { "-r", "runtime" }, @"exec <msbuildpath> /m /v:m /t:Build /p:RuntimeIdentifier=runtime /clp:Summary")]
|
||||
[InlineData(new string[] { "--runtime", "runtime" }, @"exec <msbuildpath> /m /v:m /t:Build /p:RuntimeIdentifier=runtime /clp:Summary")]
|
||||
[InlineData(new string[] { "-c", "configuration" }, @"exec <msbuildpath> /m /v:m /t:Build /p:Configuration=configuration /clp:Summary")]
|
||||
[InlineData(new string[] { "--configuration", "configuration" }, @"exec <msbuildpath> /m /v:m /t:Build /p:Configuration=configuration /clp:Summary")]
|
||||
[InlineData(new string[] { "--version-suffix", "mysuffix" }, @"exec <msbuildpath> /m /v:m /t:Build /p:VersionSuffix=mysuffix /clp:Summary")]
|
||||
[InlineData(new string[] { "--no-dependencies" }, @"exec <msbuildpath> /m /v:m /t:Build /p:BuildProjectReferences=false /clp:Summary")]
|
||||
[InlineData(new string[] { "-v", "verbosity" }, @"exec <msbuildpath> /m /v:m /t:Build /verbosity:verbosity /clp:Summary")]
|
||||
[InlineData(new string[] { "--verbosity", "verbosity" }, @"exec <msbuildpath> /m /v:m /t:Build /verbosity:verbosity /clp:Summary")]
|
||||
[InlineData(new string[] { "--no-incremental", "-o", "myoutput", "-r", "myruntime", "-v", "diag" }, @"exec <msbuildpath> /m /v:m /t:Rebuild /p:OutputPath=myoutput /p:RuntimeIdentifier=myruntime /verbosity:diag /clp:Summary")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedCommand)
|
||||
[InlineData(new string[] { }, "")]
|
||||
[InlineData(new string[] { "-s", "<source>" }, "/p:RestoreSources=<source>")]
|
||||
[InlineData(new string[] { "--source", "<source>" }, "/p:RestoreSources=<source>")]
|
||||
[InlineData(new string[] { "-s", "<source0>", "-s", "<source1>" }, "/p:RestoreSources=<source0>%3B<source1>")]
|
||||
[InlineData(new string[] { "-r", "<runtime>" }, "/p:RuntimeIdentifiers=<runtime>")]
|
||||
[InlineData(new string[] { "--runtime", "<runtime>" }, "/p:RuntimeIdentifiers=<runtime>")]
|
||||
[InlineData(new string[] { "-r", "<runtime0>", "-r", "<runtime1>" }, "/p:RuntimeIdentifiers=<runtime0>%3B<runtime1>")]
|
||||
[InlineData(new string[] { "--packages", "<packages>" }, "/p:RestorePackagesPath=<packages>")]
|
||||
[InlineData(new string[] { "--disable-parallel" }, "/p:RestoreDisableParallel=true")]
|
||||
[InlineData(new string[] { "--configfile", "<config>" }, "/p:RestoreConfigFile=<config>")]
|
||||
[InlineData(new string[] { "--no-cache" }, "/p:RestoreNoCache=true")]
|
||||
[InlineData(new string[] { "--ignore-failed-sources" }, "/p:RestoreIgnoreFailedSources=true")]
|
||||
[InlineData(new string[] { "--no-dependencies" }, "/p:RestoreRecursive=false")]
|
||||
[InlineData(new string[] { "-v", "<verbosity>" }, @"/verbosity:<verbosity>")]
|
||||
[InlineData(new string[] { "--verbosity", "<verbosity>" }, @"/verbosity:<verbosity>")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
{
|
||||
expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}");
|
||||
|
||||
var msbuildPath = "<msbuildpath>";
|
||||
BuildCommand.FromArgs(args, msbuildPath)
|
||||
.GetProcessStartInfo().Arguments.Should().Be(expectedCommand);
|
||||
throw new NotImplementedException();
|
||||
RestoreCommand.FromArgs(args, msbuildPath)
|
||||
.GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix}{expectedAdditionalArgs}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue