From 9cb2c7a8d63c176040860ec94e1e9493caa2d841 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 27 Sep 2018 10:19:19 -0700 Subject: [PATCH] Update Cli.FunctionalTests for latest 2.2-preview3 (#1425) --- .../Templates/AngularTemplate.cs | 50 ++------ .../Templates/MvcTemplate.cs | 38 ++---- .../Templates/RazorBootstrapJQueryTemplate.cs | 119 ++++++------------ .../Templates/RazorTemplate.cs | 37 ++---- .../Templates/ReactTemplate.cs | 44 ++----- .../Templates/WebTemplate.cs | 71 ++++------- 6 files changed, 101 insertions(+), 258 deletions(-) diff --git a/test/Cli.FunctionalTests/Templates/AngularTemplate.cs b/test/Cli.FunctionalTests/Templates/AngularTemplate.cs index debc4a6a9d..d5d3b9367a 100644 --- a/test/Cli.FunctionalTests/Templates/AngularTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/AngularTemplate.cs @@ -1,12 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; -using Cli.FunctionalTests.Util; namespace Cli.FunctionalTests.Templates { @@ -23,45 +21,17 @@ namespace Cli.FunctionalTests.Templates .Select(f => Regex.Replace(f, @"\.[0-9a-f]{20}\.", ".[HASH].")); } - private IDictionary>> _additionalFilesAfterPublish => - new Dictionary>>() - { - { "common", () => new[] - { - Path.Combine("wwwroot", "favicon.ico"), - Path.Combine("ClientApp", "dist", "3rdpartylicenses.txt"), - Path.Combine("ClientApp", "dist", "index.html"), - } - }, - { "netcoreapp2.1", () => - _additionalFilesAfterPublish["common"]() - .Concat(new[] - { - Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.[HASH].woff2"), - Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.[HASH].svg"), - Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.[HASH].ttf"), - Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.[HASH].eot"), - Path.Combine("ClientApp", "dist", "glyphicons-halflings-regular.[HASH].woff"), - Path.Combine("ClientApp", "dist", $"inline.[HASH].bundle.js"), - Path.Combine("ClientApp", "dist", $"main.[HASH].bundle.js"), - Path.Combine("ClientApp", "dist", $"polyfills.[HASH].bundle.js"), - Path.Combine("ClientApp", "dist", $"styles.[HASH].bundle.css"), - }) - }, - { "netcoreapp2.2", () => - _additionalFilesAfterPublish["common"]() - .Concat(new[] - { - Path.Combine("ClientApp", "dist", $"runtime.[HASH].js"), - Path.Combine("ClientApp", "dist", $"main.[HASH].js"), - Path.Combine("ClientApp", "dist", $"polyfills.[HASH].js"), - Path.Combine("ClientApp", "dist", $"styles.[HASH].css"), - }) - }, - }; - public override IEnumerable ExpectedFilesAfterPublish => base.ExpectedFilesAfterPublish - .Concat(_additionalFilesAfterPublish[DotNetUtil.TargetFrameworkMoniker]()); + .Concat(new[] + { + Path.Combine("wwwroot", "favicon.ico"), + Path.Combine("ClientApp", "dist", "3rdpartylicenses.txt"), + Path.Combine("ClientApp", "dist", "index.html"), + Path.Combine("ClientApp", "dist", $"runtime.[HASH].js"), + Path.Combine("ClientApp", "dist", $"main.[HASH].js"), + Path.Combine("ClientApp", "dist", $"polyfills.[HASH].js"), + Path.Combine("ClientApp", "dist", $"styles.[HASH].css"), + }); } } diff --git a/test/Cli.FunctionalTests/Templates/MvcTemplate.cs b/test/Cli.FunctionalTests/Templates/MvcTemplate.cs index ca5a9cdf65..2c4514d9f9 100644 --- a/test/Cli.FunctionalTests/Templates/MvcTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/MvcTemplate.cs @@ -1,11 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Cli.FunctionalTests.Util; namespace Cli.FunctionalTests.Templates { @@ -17,33 +15,17 @@ namespace Cli.FunctionalTests.Templates protected override string RazorPath => "Views"; - private IDictionary>> _additionalObjFilesAfterBuild => - new Dictionary>>() - { - { "common", () => new[] - { - Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Home", "Index.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Home", "Privacy.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "_CookieConsentPartial.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "_Layout.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "_ValidationScriptsPartial.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "Error.g.cshtml.cs"), - } - }, - { "netcoreapp2.1", () => - _additionalObjFilesAfterBuild["common"]() - .Concat(new[] - { - Path.Combine("Razor", RazorPath, "Home", "About.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Home", "Contact.g.cshtml.cs"), - }) - }, - { "netcoreapp2.2", () => _additionalObjFilesAfterBuild["common"]() }, - }; - public override IEnumerable ExpectedObjFilesAfterBuild => base.ExpectedObjFilesAfterBuild - .Concat(_additionalObjFilesAfterBuild[DotNetUtil.TargetFrameworkMoniker]().Select(p => Path.Combine(OutputPath, p))); + .Concat(new[] + { + Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Home", "Index.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Home", "Privacy.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "_CookieConsentPartial.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "_Layout.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "_ValidationScriptsPartial.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "Error.g.cshtml.cs"), + }.Select(p => Path.Combine(OutputPath, p))); } } diff --git a/test/Cli.FunctionalTests/Templates/RazorBootstrapJQueryTemplate.cs b/test/Cli.FunctionalTests/Templates/RazorBootstrapJQueryTemplate.cs index 645ab55dd9..0ddc5a4539 100644 --- a/test/Cli.FunctionalTests/Templates/RazorBootstrapJQueryTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/RazorBootstrapJQueryTemplate.cs @@ -1,94 +1,55 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Cli.FunctionalTests.Util; namespace Cli.FunctionalTests.Templates { public abstract class RazorBootstrapJQueryTemplate : RazorApplicationBaseTemplate { - private IDictionary>> _additionalFilesAfterPublish => - new Dictionary>>() - { - { "common", () => new[] - { - Path.Combine("wwwroot", "favicon.ico"), - Path.Combine("wwwroot", "css", "site.css"), - Path.Combine("wwwroot", "css", "site.min.css"), - Path.Combine("wwwroot", "images", "banner1.svg"), - Path.Combine("wwwroot", "images", "banner2.svg"), - Path.Combine("wwwroot", "images", "banner3.svg"), - Path.Combine("wwwroot", "js", "site.js"), - Path.Combine("wwwroot", "js", "site.min.js"), - Path.Combine("wwwroot", "lib", "bootstrap", "LICENSE"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.min.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.min.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.js"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.min.js"), - Path.Combine("wwwroot", "lib", "jquery", ".bower.json"), - Path.Combine("wwwroot", "lib", "jquery", "LICENSE.txt"), - Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.js"), - Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.min.js"), - Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.min.map"), - Path.Combine("wwwroot", "lib", "jquery-validation", ".bower.json"), - Path.Combine("wwwroot", "lib", "jquery-validation", "LICENSE.md"), - Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "additional-methods.js"), - Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "additional-methods.min.js"), - Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "jquery.validate.js"), - Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "jquery.validate.min.js"), - Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "jquery.validate.unobtrusive.js"), - Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "jquery.validate.unobtrusive.min.js"), - Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "LICENSE.txt"), - } - }, - { "netcoreapp2.1", () => - _additionalFilesAfterPublish["common"]() - .Concat(new[] - { - Path.Combine("wwwroot", "lib", "bootstrap", ".bower.json"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.min.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-theme.min.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.eot"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.svg"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.ttf"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.woff"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "fonts", "glyphicons-halflings-regular.woff2"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "npm.js"), - Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", ".bower.json"), - }) - }, - { "netcoreapp2.2", () => - _additionalFilesAfterPublish["common"]() - .Concat(new[] - { - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.min.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.min.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.min.css"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.min.css.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.js"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.js.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.min.js"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.min.js.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.js.map"), - Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.min.js.map"), - }) - }, - }; - public override IEnumerable ExpectedFilesAfterPublish => base.ExpectedFilesAfterPublish - .Concat(_additionalFilesAfterPublish[DotNetUtil.TargetFrameworkMoniker]()); + .Concat(new[] { + Path.Combine("wwwroot", "favicon.ico"), + Path.Combine("wwwroot", "css", "site.css"), + Path.Combine("wwwroot", "js", "site.js"), + Path.Combine("wwwroot", "lib", "bootstrap", "LICENSE"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.css"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.css.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.min.css"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap.min.css.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.js"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.min.js"), + Path.Combine("wwwroot", "lib", "jquery", ".bower.json"), + Path.Combine("wwwroot", "lib", "jquery", "LICENSE.txt"), + Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.js"), + Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.min.js"), + Path.Combine("wwwroot", "lib", "jquery", "dist", "jquery.min.map"), + Path.Combine("wwwroot", "lib", "jquery-validation", ".bower.json"), + Path.Combine("wwwroot", "lib", "jquery-validation", "LICENSE.md"), + Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "additional-methods.js"), + Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "additional-methods.min.js"), + Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "jquery.validate.js"), + Path.Combine("wwwroot", "lib", "jquery-validation", "dist", "jquery.validate.min.js"), + Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "jquery.validate.unobtrusive.js"), + Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "jquery.validate.unobtrusive.min.js"), + Path.Combine("wwwroot", "lib", "jquery-validation-unobtrusive", "LICENSE.txt"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.css"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.css.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.min.css"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-grid.min.css.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.css"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.css.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.min.css"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "css", "bootstrap-reboot.min.css.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.js"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.js.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.min.js"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.bundle.min.js.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.js.map"), + Path.Combine("wwwroot", "lib", "bootstrap", "dist", "js", "bootstrap.min.js.map"), + }); } } diff --git a/test/Cli.FunctionalTests/Templates/RazorTemplate.cs b/test/Cli.FunctionalTests/Templates/RazorTemplate.cs index 778ef5833d..ab8c235185 100644 --- a/test/Cli.FunctionalTests/Templates/RazorTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/RazorTemplate.cs @@ -1,11 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Cli.FunctionalTests.Util; namespace Cli.FunctionalTests.Templates { @@ -17,33 +15,16 @@ namespace Cli.FunctionalTests.Templates protected override string RazorPath => "Pages"; - private IDictionary>> _additionalObjFilesAfterBuild => - new Dictionary>>() - { - { "common", () => new[] - { - Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Error.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Index.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Privacy.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "_CookieConsentPartial.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "_Layout.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Shared", "_ValidationScriptsPartial.g.cshtml.cs"), - } - }, - { "netcoreapp2.1", () => - _additionalObjFilesAfterBuild["common"]() - .Concat(new[] - { - Path.Combine("Razor", RazorPath, "About.g.cshtml.cs"), - Path.Combine("Razor", RazorPath, "Contact.g.cshtml.cs"), - }) - }, - { "netcoreapp2.2", () => _additionalObjFilesAfterBuild["common"]() }, - }; - public override IEnumerable ExpectedObjFilesAfterBuild => base.ExpectedObjFilesAfterBuild - .Concat(_additionalObjFilesAfterBuild[DotNetUtil.TargetFrameworkMoniker]().Select(p => Path.Combine(OutputPath, p))); + .Concat(new[] { + Path.Combine("Razor", RazorPath, "_ViewStart.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Error.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Index.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Privacy.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "_CookieConsentPartial.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "_Layout.g.cshtml.cs"), + Path.Combine("Razor", RazorPath, "Shared", "_ValidationScriptsPartial.g.cshtml.cs"), + }.Select(p => Path.Combine(OutputPath, p))); } } diff --git a/test/Cli.FunctionalTests/Templates/ReactTemplate.cs b/test/Cli.FunctionalTests/Templates/ReactTemplate.cs index 212f4763c5..6cf5f2c1b8 100644 --- a/test/Cli.FunctionalTests/Templates/ReactTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/ReactTemplate.cs @@ -1,12 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; -using Cli.FunctionalTests.Util; namespace Cli.FunctionalTests.Templates { @@ -23,38 +21,18 @@ namespace Cli.FunctionalTests.Templates .Select(f => Regex.Replace(f, @"\.[0-9a-f]{8}\.", ".[HASH].")); } - private IDictionary>> _additionalFilesAfterPublish => - new Dictionary>>() - { - { "common", () => new[] - { - Path.Combine("ClientApp", "build", "asset-manifest.json"), - Path.Combine("ClientApp", "build", "favicon.ico"), - Path.Combine("ClientApp", "build", "index.html"), - Path.Combine("ClientApp", "build", "manifest.json"), - Path.Combine("ClientApp", "build", "service-worker.js"), - Path.Combine("ClientApp", "build", "static", "css", "main.[HASH].css"), - Path.Combine("ClientApp", "build", "static", "css", "main.[HASH].css.map"), - Path.Combine("ClientApp", "build", "static", "js", "main.[HASH].js"), - Path.Combine("ClientApp", "build", "static", "js", "main.[HASH].js.map"), - } - }, - { "netcoreapp2.1", () => - _additionalFilesAfterPublish["common"]() - .Concat(new[] - { - Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.[HASH].woff2"), - Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.[HASH].svg"), - Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.[HASH].ttf"), - Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.[HASH].eot"), - Path.Combine("ClientApp", "build", "static", "media", "glyphicons-halflings-regular.[HASH].woff"), - }) - }, - { "netcoreapp2.2", () => _additionalFilesAfterPublish["common"]() }, - }; - public override IEnumerable ExpectedFilesAfterPublish => base.ExpectedFilesAfterPublish - .Concat(_additionalFilesAfterPublish[DotNetUtil.TargetFrameworkMoniker]()); + .Concat(new[] { + Path.Combine("ClientApp", "build", "asset-manifest.json"), + Path.Combine("ClientApp", "build", "favicon.ico"), + Path.Combine("ClientApp", "build", "index.html"), + Path.Combine("ClientApp", "build", "manifest.json"), + Path.Combine("ClientApp", "build", "service-worker.js"), + Path.Combine("ClientApp", "build", "static", "css", "main.[HASH].css"), + Path.Combine("ClientApp", "build", "static", "css", "main.[HASH].css.map"), + Path.Combine("ClientApp", "build", "static", "js", "main.[HASH].js"), + Path.Combine("ClientApp", "build", "static", "js", "main.[HASH].js.map"), + }); } } diff --git a/test/Cli.FunctionalTests/Templates/WebTemplate.cs b/test/Cli.FunctionalTests/Templates/WebTemplate.cs index 3571ca6cfc..ea584efb3c 100644 --- a/test/Cli.FunctionalTests/Templates/WebTemplate.cs +++ b/test/Cli.FunctionalTests/Templates/WebTemplate.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using Cli.FunctionalTests.Util; namespace Cli.FunctionalTests.Templates { @@ -17,7 +16,7 @@ namespace Cli.FunctionalTests.Templates public override TemplateType Type => TemplateType.WebApplication; - public override IEnumerable ExpectedObjFilesAfterBuild => + public override IEnumerable ExpectedObjFilesAfterBuild => base.ExpectedObjFilesAfterBuild .Concat(new[] { @@ -26,18 +25,21 @@ namespace Cli.FunctionalTests.Templates $"{Name}.RazorTargetAssemblyInfo.cache", }.Select(p => Path.Combine(OutputPath, p))); - private IDictionary<(string TargetFrameworkMoniker, RuntimeIdentifier), Func>> _additionalFilesAfterPublish => - new Dictionary<(string TargetFrameworkMoniker, RuntimeIdentifier), Func>>() + private IDictionary>> _additionalFilesAfterPublish => + new Dictionary>>() { - { ("netcoreapp2.1", RuntimeIdentifier.None), () => new[] + { RuntimeIdentifier.None, () => new[] { // Publish includes all *.config and *.json files (https://github.com/aspnet/websdk/issues/334) "NuGet.config", "web.config", + + "appsettings.Development.json", + "appsettings.json", } }, - { ("netcoreapp2.1", RuntimeIdentifier.Linux_x64), () => - _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.None)]() + { RuntimeIdentifier.Linux_x64, () => + _additionalFilesAfterPublish[RuntimeIdentifier.None]() .Concat(new[] { "Microsoft.AspNetCore.Antiforgery.dll", @@ -66,6 +68,7 @@ namespace Cli.FunctionalTests.Templates "Microsoft.AspNetCore.Diagnostics.Abstractions.dll", "Microsoft.AspNetCore.Diagnostics.dll", "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.dll", + "Microsoft.AspNetCore.Diagnostics.HealthChecks.dll", "Microsoft.AspNetCore.dll", "Microsoft.AspNetCore.HostFiltering.dll", "Microsoft.AspNetCore.Hosting.Abstractions.dll", @@ -83,7 +86,8 @@ namespace Cli.FunctionalTests.Templates "Microsoft.AspNetCore.Identity.dll", "Microsoft.AspNetCore.Identity.EntityFrameworkCore.dll", "Microsoft.AspNetCore.Identity.UI.dll", - "Microsoft.AspNetCore.Identity.UI.Views.dll", + "Microsoft.AspNetCore.Identity.UI.Views.V3.dll", + "Microsoft.AspNetCore.Identity.UI.Views.V4.dll", "Microsoft.AspNetCore.JsonPatch.dll", "Microsoft.AspNetCore.Localization.dll", "Microsoft.AspNetCore.Localization.Routing.dll", @@ -114,6 +118,7 @@ namespace Cli.FunctionalTests.Templates "Microsoft.AspNetCore.Routing.Abstractions.dll", "Microsoft.AspNetCore.Routing.dll", "Microsoft.AspNetCore.Server.HttpSys.dll", + "Microsoft.AspNetCore.Server.IIS.dll", "Microsoft.AspNetCore.Server.IISIntegration.dll", "Microsoft.AspNetCore.Server.Kestrel.Core.dll", "Microsoft.AspNetCore.Server.Kestrel.dll", @@ -158,6 +163,8 @@ namespace Cli.FunctionalTests.Templates "Microsoft.Extensions.DependencyInjection.dll", "Microsoft.Extensions.DependencyModel.dll", "Microsoft.Extensions.DiagnosticAdapter.dll", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.dll", + "Microsoft.Extensions.Diagnostics.HealthChecks.dll", "Microsoft.Extensions.FileProviders.Abstractions.dll", "Microsoft.Extensions.FileProviders.Composite.dll", "Microsoft.Extensions.FileProviders.Embedded.dll", @@ -179,6 +186,7 @@ namespace Cli.FunctionalTests.Templates "Microsoft.Extensions.Logging.TraceSource.dll", "Microsoft.Extensions.ObjectPool.dll", "Microsoft.Extensions.Options.ConfigurationExtensions.dll", + "Microsoft.Extensions.Options.DataAnnotations.dll", "Microsoft.Extensions.Options.dll", "Microsoft.Extensions.Primitives.dll", "Microsoft.Extensions.WebEncoders.dll", @@ -208,48 +216,11 @@ namespace Cli.FunctionalTests.Templates "System.Threading.Channels.dll", }) }, - { ("netcoreapp2.1", RuntimeIdentifier.OSX_x64), () => - _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.Linux_x64)]() + { RuntimeIdentifier.OSX_x64, () => + _additionalFilesAfterPublish[RuntimeIdentifier.Linux_x64]() }, - { ("netcoreapp2.1", RuntimeIdentifier.Win_x64), () => - _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.Linux_x64)]() - .Concat(new[] - { - "sni.dll", - }) - }, - { ("netcoreapp2.2", RuntimeIdentifier.None), () => - _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.None)]() - .Concat(new[] - { - "appsettings.Development.json", - "appsettings.json", - }) - }, - { ("netcoreapp2.2", RuntimeIdentifier.Linux_x64), () => - _additionalFilesAfterPublish[("netcoreapp2.1", RuntimeIdentifier.Linux_x64)]() - .Except(new[] - { - "Microsoft.AspNetCore.Identity.UI.Views.dll", - }) - .Concat(new[] - { - "appsettings.Development.json", - "appsettings.json", - "Microsoft.AspNetCore.Diagnostics.HealthChecks.dll", - "Microsoft.AspNetCore.Identity.UI.Views.V3.dll", - "Microsoft.AspNetCore.Identity.UI.Views.V4.dll", - "Microsoft.AspNetCore.Server.IIS.dll", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.dll", - "Microsoft.Extensions.Diagnostics.HealthChecks.dll", - "Microsoft.Extensions.Options.DataAnnotations.dll", - }) - }, - { ("netcoreapp2.2", RuntimeIdentifier.OSX_x64), () => - _additionalFilesAfterPublish[("netcoreapp2.2", RuntimeIdentifier.Linux_x64)]() - }, - { ("netcoreapp2.2", RuntimeIdentifier.Win_x64), () => - _additionalFilesAfterPublish[("netcoreapp2.2", RuntimeIdentifier.Linux_x64)]() + { RuntimeIdentifier.Win_x64, () => + _additionalFilesAfterPublish[RuntimeIdentifier.Linux_x64]() .Concat(new[] { "aspnetcorev2_inprocess.dll", @@ -260,6 +231,6 @@ namespace Cli.FunctionalTests.Templates public override IEnumerable ExpectedFilesAfterPublish => base.ExpectedFilesAfterPublish - .Concat(_additionalFilesAfterPublish[(DotNetUtil.TargetFrameworkMoniker, RuntimeIdentifier)]()); + .Concat(_additionalFilesAfterPublish[RuntimeIdentifier]()); } }