diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 89fc3c8b3..ce49cc383 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -79,9 +79,9 @@ https://github.com/dotnet/test-templates e8e924b5937e75ab3049d57cb5fb196ea2e3332c - + https://github.com/dotnet/templating - f15388ee6e45a8923fba0f54f55154aee991fb84 + bd8fc17967503221519906c76546192e14fcdfa8 https://github.com/dotnet/sdk diff --git a/eng/Versions.props b/eng/Versions.props index 16eeeff76..a7c53afc1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -25,7 +25,7 @@ - 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20164.4 diff --git a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs index 6b85a2400..9f99f850b 100644 --- a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs +++ b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs @@ -1,9 +1,6 @@ using System; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.InteropServices; -using System.Text; using System.Xml.Linq; using FluentAssertions; using Microsoft.DotNet.TestFramework; @@ -157,7 +154,7 @@ namespace EndToEnd .Element(ns + "TargetFramework") .Value; - SupportedNetCoreAppVersions.Versions.Select(v => $"netcoreapp{v}") + TargetFrameworkHelper.GetNetAppTargetFrameworks(SupportedNetCoreAppVersions.Versions) .Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)}.{nameof(SupportedNetCoreAppVersions.Versions)} property should include the default version " + "of .NET Core created by \"dotnet new\""); } @@ -184,12 +181,9 @@ namespace EndToEnd .Element(ns + "TargetFramework") .Value; - SupportedAspNetCoreVersions.Versions.Select(v => $"netcoreapp{v}") + TargetFrameworkHelper.GetNetAppTargetFrameworks(SupportedAspNetCoreVersions.Versions) .Should().Contain(targetFramework, $"the {nameof(SupportedAspNetCoreVersions)} should include the default version " + - "of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\""); - - + "of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\""); } - } } diff --git a/test/EndToEnd/SupportedNetCoreAppVersions.cs b/test/EndToEnd/SupportedNetCoreAppVersions.cs index 512b9e78a..9504a0c97 100644 --- a/test/EndToEnd/SupportedNetCoreAppVersions.cs +++ b/test/EndToEnd/SupportedNetCoreAppVersions.cs @@ -2,33 +2,34 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using Xunit; namespace EndToEnd { + public static class TargetFrameworkHelper + { + private static Version _firstNetAppVersion = new Version(5, 0); + + public static IEnumerable GetNetAppTargetFrameworks(IEnumerable versions) => + versions.Select(v => $"netcoreapp{v}") + // Add netX.X tfms starting with 5.0 + .Concat(versions.Where(v => Version.Parse(v) >= _firstNetAppVersion).Select(v => $"net{v}")); + } + public class SupportedNetCoreAppVersions : IEnumerable { public IEnumerator GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - public static IEnumerable Versions + public static IEnumerable Versions => new[] { - get - { - return new[] - { - "1.0", - "1.1", - "2.0", - "2.1", - "2.2", - "3.0", - "3.1", - "5.0" - }; - } - } - - + "1.0", + "1.1", + "2.0", + "2.1", + "2.2", + "3.0", + "3.1", + "5.0" + }; } public class SupportedAspNetCoreVersions : IEnumerable @@ -36,13 +37,8 @@ namespace EndToEnd public IEnumerator GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - public static IEnumerable Versions - { - get - { - return SupportedNetCoreAppVersions.Versions.Except(new List() { "1.0", "1.1", "2.0" }); - } - } + public static IEnumerable Versions => + SupportedNetCoreAppVersions.Versions.Except(new List() { "1.0", "1.1", "2.0" }); } public class SupportedAspNetCoreAllVersions : IEnumerable @@ -50,12 +46,7 @@ namespace EndToEnd public IEnumerator GetEnumerator() => Versions.Select(version => new object[] { version }).GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - public static IEnumerable Versions - { - get - { - return SupportedAspNetCoreVersions.Versions.Where(v => new Version(v).Major < 3); - } - } + public static IEnumerable Versions => + SupportedAspNetCoreVersions.Versions.Where(v => new Version(v).Major < 3); } }