Test reliability and format cleanups

This commit is contained in:
Piotr Puszkiewicz 2016-08-18 15:25:16 -07:00
parent a1e3218023
commit e92c9603c8
3 changed files with 20 additions and 11 deletions

View file

@ -78,7 +78,7 @@
<Target Name="RestoreTests"
DependsOnTargets="CreateTestAssetPackageNuPkgs;
CleanTestProjectsBinObj;
CleanTestProjectsBinObjProjectJson;
SetupRestoreTestsInputs;"
Inputs="@(RestoreTestsInputs)"
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
@ -89,13 +89,13 @@
WorkingDirectory="$(TestDirectory)" />
</Target>
<Target Name="CleanTestProjectsBinObj"
<Target Name="CleanTestProjectsBinObjProjectJson"
DependsOnTargets="SetupRestoreTestsInputs;"
Inputs="@(RestoreTestsInputs)"
Outputs="@(RestoreTestsInputs->'%(RelativeDir)project.lock.json')">
<ItemGroup>
<FilesToDelete Include="$(TestDirectory)**/bin/**/*.*" />
<FilesToDelete Include="$(TestDirectory)**/obj/**/*.*" />
<FilesToDelete Include="$(TestDirectory)**/bin/**/project.json" />
<FilesToDelete Include="$(TestDirectory)**/obj/**/project.json" />
</ItemGroup>
<Delete Files="@(FilesToDelete)" />

View file

@ -6,7 +6,7 @@
"dependencies": {
"System.Runtime.Serialization.Primitives": "4.1.1",
"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"
},
"testRunner": "xunit",

View file

@ -31,14 +31,15 @@ namespace Microsoft.DotNet.Tests
_firstDotnetNonVerbUseCommandResult = command.ExecuteWithCapturedOutput("--info");
_firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new");
_nugetCacheFolder = new DirectoryInfo(testNugetCache);
}
[Fact]
public void Using_dotnet_for_the_first_time_succeeds()
{
_firstDotnetVerbUseCommandResult.Should().Pass();
_firstDotnetVerbUseCommandResult
.Should()
.Pass();
}
[Fact]
@ -46,7 +47,9 @@ namespace Microsoft.DotNet.Tests
{
const string firstTimeNonVerbUseMessage = @".NET Command Line Tools";
_firstDotnetNonVerbUseCommandResult.StdOut.Should().StartWith(firstTimeNonVerbUseMessage);
_firstDotnetNonVerbUseCommandResult.StdOut
.Should()
.StartWith(firstTimeNonVerbUseMessage);
}
[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.";
_firstDotnetVerbUseCommandResult.StdOut.Should().StartWith(firstTimeUseWelcomeMessage);
_firstDotnetVerbUseCommandResult.StdOut
.Should()
.StartWith(firstTimeUseWelcomeMessage);
}
[Fact]
public void It_restores_the_nuget_packages_to_the_nuget_cache_folder()
{
_nugetCacheFolder.Should().HaveFile($"{GetDotnetVersion()}.dotnetSentinel");
_nugetCacheFolder
.Should()
.HaveFile($"{GetDotnetVersion()}.dotnetSentinel");
}
[Fact]
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()