Test reliability and format cleanups
This commit is contained in:
parent
a1e3218023
commit
e92c9603c8
3 changed files with 20 additions and 11 deletions
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
<Target Name="RestoreTests"
|
<Target Name="RestoreTests"
|
||||||
DependsOnTargets="CreateTestAssetPackageNuPkgs;
|
DependsOnTargets="CreateTestAssetPackageNuPkgs;
|
||||||
CleanTestProjectsBinObj;
|
CleanTestProjectsBinObjProjectJson;
|
||||||
SetupRestoreTestsInputs;"
|
SetupRestoreTestsInputs;"
|
||||||
Inputs="@(RestoreTestsInputs)"
|
Inputs="@(RestoreTestsInputs)"
|
||||||
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
|
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
|
||||||
|
@ -89,13 +89,13 @@
|
||||||
WorkingDirectory="$(TestDirectory)" />
|
WorkingDirectory="$(TestDirectory)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CleanTestProjectsBinObj"
|
<Target Name="CleanTestProjectsBinObjProjectJson"
|
||||||
DependsOnTargets="SetupRestoreTestsInputs;"
|
DependsOnTargets="SetupRestoreTestsInputs;"
|
||||||
Inputs="@(RestoreTestsInputs)"
|
Inputs="@(RestoreTestsInputs)"
|
||||||
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
|
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FilesToDelete Include="$(TestDirectory)**/bin/**/*.*" />
|
<FilesToDelete Include="$(TestDirectory)**/bin/**/project.json" />
|
||||||
<FilesToDelete Include="$(TestDirectory)**/obj/**/*.*" />
|
<FilesToDelete Include="$(TestDirectory)**/obj/**/project.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Delete Files="@(FilesToDelete)" />
|
<Delete Files="@(FilesToDelete)" />
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Runtime.Serialization.Primitives": "4.1.1",
|
"System.Runtime.Serialization.Primitives": "4.1.1",
|
||||||
"xunit": "2.1.0",
|
"xunit": "2.1.0",
|
||||||
"dotnet-test-xunit": "1.0.0-rc2-192208-24",
|
"dotnet-test-xunit": "1.0.0-rc2-318883-21",
|
||||||
"Microsoft.DotNet.InternalAbstractions": "1.0.0"
|
"Microsoft.DotNet.InternalAbstractions": "1.0.0"
|
||||||
},
|
},
|
||||||
"testRunner": "xunit",
|
"testRunner": "xunit",
|
||||||
|
|
|
@ -31,14 +31,15 @@ namespace Microsoft.DotNet.Tests
|
||||||
|
|
||||||
_firstDotnetNonVerbUseCommandResult = command.ExecuteWithCapturedOutput("--info");
|
_firstDotnetNonVerbUseCommandResult = command.ExecuteWithCapturedOutput("--info");
|
||||||
_firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new");
|
_firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new");
|
||||||
|
|
||||||
_nugetCacheFolder = new DirectoryInfo(testNugetCache);
|
_nugetCacheFolder = new DirectoryInfo(testNugetCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Using_dotnet_for_the_first_time_succeeds()
|
public void Using_dotnet_for_the_first_time_succeeds()
|
||||||
{
|
{
|
||||||
_firstDotnetVerbUseCommandResult.Should().Pass();
|
_firstDotnetVerbUseCommandResult
|
||||||
|
.Should()
|
||||||
|
.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -46,7 +47,9 @@ namespace Microsoft.DotNet.Tests
|
||||||
{
|
{
|
||||||
const string firstTimeNonVerbUseMessage = @".NET Command Line Tools";
|
const string firstTimeNonVerbUseMessage = @".NET Command Line Tools";
|
||||||
|
|
||||||
_firstDotnetNonVerbUseCommandResult.StdOut.Should().StartWith(firstTimeNonVerbUseMessage);
|
_firstDotnetNonVerbUseCommandResult.StdOut
|
||||||
|
.Should()
|
||||||
|
.StartWith(firstTimeNonVerbUseMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -64,19 +67,25 @@ Configuring...
|
||||||
-------------------
|
-------------------
|
||||||
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.";
|
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.";
|
||||||
|
|
||||||
_firstDotnetVerbUseCommandResult.StdOut.Should().StartWith(firstTimeUseWelcomeMessage);
|
_firstDotnetVerbUseCommandResult.StdOut
|
||||||
|
.Should()
|
||||||
|
.StartWith(firstTimeUseWelcomeMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_restores_the_nuget_packages_to_the_nuget_cache_folder()
|
public void It_restores_the_nuget_packages_to_the_nuget_cache_folder()
|
||||||
{
|
{
|
||||||
_nugetCacheFolder.Should().HaveFile($"{GetDotnetVersion()}.dotnetSentinel");
|
_nugetCacheFolder
|
||||||
|
.Should()
|
||||||
|
.HaveFile($"{GetDotnetVersion()}.dotnetSentinel");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_creates_a_sentinel_file_under_the_nuget_cache_folder()
|
public void It_creates_a_sentinel_file_under_the_nuget_cache_folder()
|
||||||
{
|
{
|
||||||
_nugetCacheFolder.Should().HaveDirectory("microsoft.netcore.app");
|
_nugetCacheFolder
|
||||||
|
.Should()
|
||||||
|
.HaveDirectory("microsoft.netcore.app");
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetDotnetVersion()
|
private string GetDotnetVersion()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue