Enable / fix tests

This commit is contained in:
Daniel Plaisted 2018-11-12 15:24:05 -08:00
parent b1b9dfda09
commit b395776e87
2 changed files with 13 additions and 8 deletions

View file

@ -39,7 +39,7 @@ namespace EndToEnd
// Get the implicit version // Get the implicit version
new RestoreCommand() new RestoreCommand()
.WithWorkingDirectory(projectDirectory) .WithWorkingDirectory(projectDirectory)
.Execute() .Execute("/bl:restore.binlog")
.Should().Pass(); .Should().Pass();
var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
@ -102,17 +102,22 @@ namespace EndToEnd
"Please update MSBuildExtensions.targets in this repo so these versions match."); "Please update MSBuildExtensions.targets in this repo so these versions match.");
} }
[Theory(Skip = "https://github.com/dotnet/core-sdk/issues/21")] [Theory]
[MemberData(nameof(SupportedAspNetCoreAppVersions))] [MemberData(nameof(SupportedAspNetCoreAppVersions))]
public void ItRollsForwardToTheLatestVersion(string minorVersion) public void ItRollsForwardToTheLatestVersion(string minorVersion)
{ {
var _testInstance = TestAssets.Get(AspNetTestProject) var testProjectCreator = new TestProjectCreator(identifier: minorVersion)
.CreateInstance(identifier: minorVersion) {
PackageName = TestProjectCreator.AspNetCoreAppPackageName,
MinorVersion = minorVersion ,
};
var _testInstance = testProjectCreator.Create()
.WithSourceFiles(); .WithSourceFiles();
string projectDirectory = _testInstance.Root.FullName; string projectDirectory = _testInstance.Root.FullName;
string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); string projectPath = Path.Combine(projectDirectory, $"TestAppSimple.csproj");
var project = XDocument.Load(projectPath); var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace; var ns = project.Root.Name.Namespace;
@ -172,7 +177,7 @@ namespace EndToEnd
"(see MSBuildExtensions.targets in this repo)"); "(see MSBuildExtensions.targets in this repo)");
} }
[Fact(Skip = "https://github.com/dotnet/core-sdk/issues/21")] [Fact]
public void WeCoverLatestAspNetCoreAppRollForward() public void WeCoverLatestAspNetCoreAppRollForward()
{ {
var directory = TestAssets.CreateTestDirectory(); var directory = TestAssets.CreateTestDirectory();
@ -202,7 +207,7 @@ namespace EndToEnd
private NuGetVersion GetAspNetCoreAppVersion(LockFile lockFile, bool portable = false) private NuGetVersion GetAspNetCoreAppVersion(LockFile lockFile, bool portable = false)
{ {
return lockFile?.Targets?.SingleOrDefault(t => portable || t.RuntimeIdentifier != null) return lockFile?.Targets?.SingleOrDefault(t => portable == (t.RuntimeIdentifier == null))
?.Libraries?.SingleOrDefault(l => ?.Libraries?.SingleOrDefault(l =>
string.Compare(l.Name, "Microsoft.AspNetCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) string.Compare(l.Name, "Microsoft.AspNetCore.App", StringComparison.CurrentCultureIgnoreCase) == 0)
?.Version; ?.Version;

View file

@ -126,7 +126,7 @@ namespace EndToEnd
?.Version; ?.Version;
} }
[Fact(Skip = "https://github.com/dotnet/cli/issues/9968")] [Fact]
public void WeCoverLatestNetCoreAppRollForward() public void WeCoverLatestNetCoreAppRollForward()
{ {
// Run "dotnet new console", get TargetFramework property, and make sure it's covered in SupportedNetCoreAppVersions // Run "dotnet new console", get TargetFramework property, and make sure it's covered in SupportedNetCoreAppVersions