More test

\n\nCommit migrated from 0e750a6764
This commit is contained in:
Pranav K 2019-07-17 09:20:32 -07:00
parent 9b05f240ae
commit 8757c7da16
4 changed files with 24 additions and 5 deletions

View File

@ -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";

View File

@ -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()
{

View File

@ -8,6 +8,7 @@
<ProjectReference Include="..\SimpleMvc11\SimpleMvc11.csproj" />
<ProjectReference Include="..\SimpleMvc21\SimpleMvc21.csproj" />
<ProjectReference Include="..\SimpleMvc22\SimpleMvc22.csproj" />
<ProjectReference Include="..\SimpleMvc22NetFx\SimpleMvc22NetFx.csproj" />
<ProjectReference Include="..\ClassLibraryMvc21\ClassLibraryMvc21.csproj" />
<ProjectReference Include="..\AppWithP2PReference\AppWithP2PReference.csproj" />

View File

@ -12,7 +12,6 @@
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />