From 8757c7da1676c370ecdbfb1aff05e32b83dd024a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 17 Jul 2019 09:20:32 -0700 Subject: [PATCH] More test \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/0e750a676411ca68f0b8cfd92011f5f37ec872e6 --- .../BuildIntegrationTest22NetFx.cs | 9 +++++---- .../BuildIntegrationTestLegacy.cs | 18 ++++++++++++++++++ .../RestoreTestProjects.csproj | 1 + .../SimpleMvc22NetFx/SimpleMvc22NetFx.csproj | 1 - 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest22NetFx.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest22NetFx.cs index 0e95335b42..263e20747c 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest22NetFx.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest22NetFx.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests [ConditionalFact] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InitializeTestProject(TestProjectName)] - public async Task PublishingProject_CopyToOutputDirectoryFiles() + public async Task PublishingProject_CopyToPublishDirectoryItems() { TargetFramework = "net461"; @@ -51,17 +51,18 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests var result = await DotnetMSBuild("Publish"); Assert.BuildPassed(result); - // No cshtml files should be in the build output directory - Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "Views"), "*.cshtml"); // refs shouldn't be produced by default Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll"); + + // Views shouldn't be produced by default + Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "Views"), "*.cshtml"); } [ConditionalFact] [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] [InitializeTestProject(TestProjectName)] - public async Task PublishingProject_CopyToOutputDirectoryFiles_WithCopyRefAssembliesToPublishDirectory() + public async Task Publish_IncludesRefAssemblies_WhenCopyRefAssembliesToPublishDirectoryIsSet() { TargetFramework = "net461"; diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTestLegacy.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTestLegacy.cs index 2c8cf9e865..f72de92966 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTestLegacy.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTestLegacy.cs @@ -152,6 +152,24 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests } } + [Fact] + public async Task PublishingProject_CopyToPublishDirectoryItems() + { + using (CreateTestProject()) + { + // Build + var result = await DotnetMSBuild("Publish"); + + Assert.BuildPassed(result); + + // refs shouldn't be produced by default + Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "refs"), "*.dll"); + + // Views shouldn't be produced by default + Assert.FileCountEquals(result, 0, Path.Combine(PublishOutputPath, "Views"), "*.cshtml"); + } + } + [Fact] public virtual async Task Publish_IncludesRefAssemblies_WhenCopyRefAssembliesToPublishDirectoryIsSet() { diff --git a/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj b/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj index 4111cbd4dc..b7ae27c5e0 100644 --- a/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj +++ b/src/Razor/test/testassets/RestoreTestProjects/RestoreTestProjects.csproj @@ -8,6 +8,7 @@ + diff --git a/src/Razor/test/testassets/SimpleMvc22NetFx/SimpleMvc22NetFx.csproj b/src/Razor/test/testassets/SimpleMvc22NetFx/SimpleMvc22NetFx.csproj index ab338c85c3..ba2f97732b 100644 --- a/src/Razor/test/testassets/SimpleMvc22NetFx/SimpleMvc22NetFx.csproj +++ b/src/Razor/test/testassets/SimpleMvc22NetFx/SimpleMvc22NetFx.csproj @@ -12,7 +12,6 @@ full -