From b395776e870724e9a37d1ab86d7530bb9b725fbc Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Mon, 12 Nov 2018 15:24:05 -0800 Subject: [PATCH] Enable / fix tests --- .../GivenAspNetAppsResolveImplicitVersions.cs | 19 ++++++++++++------- .../GivenSelfContainedAppsRollForward.cs | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs b/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs index f9be29af0..5e3a8ad6d 100644 --- a/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs +++ b/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs @@ -39,7 +39,7 @@ namespace EndToEnd // Get the implicit version new RestoreCommand() .WithWorkingDirectory(projectDirectory) - .Execute() + .Execute("/bl:restore.binlog") .Should().Pass(); 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."); } - [Theory(Skip = "https://github.com/dotnet/core-sdk/issues/21")] + [Theory] [MemberData(nameof(SupportedAspNetCoreAppVersions))] public void ItRollsForwardToTheLatestVersion(string minorVersion) { - var _testInstance = TestAssets.Get(AspNetTestProject) - .CreateInstance(identifier: minorVersion) + var testProjectCreator = new TestProjectCreator(identifier: minorVersion) + { + PackageName = TestProjectCreator.AspNetCoreAppPackageName, + MinorVersion = minorVersion , + }; + + var _testInstance = testProjectCreator.Create() .WithSourceFiles(); 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 ns = project.Root.Name.Namespace; @@ -172,7 +177,7 @@ namespace EndToEnd "(see MSBuildExtensions.targets in this repo)"); } - [Fact(Skip = "https://github.com/dotnet/core-sdk/issues/21")] + [Fact] public void WeCoverLatestAspNetCoreAppRollForward() { var directory = TestAssets.CreateTestDirectory(); @@ -202,7 +207,7 @@ namespace EndToEnd 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 => string.Compare(l.Name, "Microsoft.AspNetCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) ?.Version; diff --git a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs index a1e988a6c..797aa84aa 100644 --- a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs +++ b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs @@ -126,7 +126,7 @@ namespace EndToEnd ?.Version; } - [Fact(Skip = "https://github.com/dotnet/cli/issues/9968")] + [Fact] public void WeCoverLatestNetCoreAppRollForward() { // Run "dotnet new console", get TargetFramework property, and make sure it's covered in SupportedNetCoreAppVersions