Skip to content

Commit e4e9261

Browse files
authored
[StaticWebAssets] Move static web assets tests into their own project (#49645)
1 parent 28faadb commit e4e9261

File tree

155 files changed

+244
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+244
-78
lines changed

sdk.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@
313313
<Project Path="test/Microsoft.NET.Sdk.Publish.Tasks.Tests/Microsoft.NET.Sdk.Publish.Tasks.Tests.csproj" />
314314
<Project Path="test/Microsoft.NET.Sdk.Razor.Tests/Microsoft.NET.Sdk.Razor.Tests.csproj" />
315315
<Project Path="test/Microsoft.NET.Sdk.Razor.Tool.Tests/Microsoft.NET.Sdk.Razor.Tool.Tests.csproj" />
316+
<Project Path="test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj" />
316317
<Project Path="test/Microsoft.NET.Sdk.Web.Tests/Microsoft.NET.Sdk.Web.Tests.csproj" />
317318
<Project Path="test/Microsoft.NET.Sdk.WorkloadManifestReader.Tests/Microsoft.NET.Sdk.WorkloadManifestReader.Tests.csproj" />
318319
<Project Path="test/Microsoft.NET.TestFramework/Microsoft.NET.TestFramework.csproj" />

src/StaticWebAssetsSdk/Tasks/Microsoft.NET.Sdk.StaticWebAssets.Tasks.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
<ItemGroup>
4545
<InternalsVisibleTo Include="Microsoft.NET.Sdk.Razor.Tests" />
46+
<InternalsVisibleTo Include="Microsoft.NET.Sdk.StaticWebAssets.Tests" />
4647
</ItemGroup>
4748

4849
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">

test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorLegacyIntegrationTest50.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Microsoft.NET.Sdk.Razor.Tests;
4+
using Microsoft.NET.Sdk.StaticWebAssets.Tests;
55

66
namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tests
77
{

test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorLegacyIntegrationTest60.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Microsoft.AspNetCore.StaticWebAssets.Tasks;
5-
using Microsoft.NET.Sdk.Razor.Tests;
5+
using Microsoft.NET.Sdk.StaticWebAssets.Tests;
66

77
namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tests
88
{
99
public class BlazorLegacyIntegrationTest60(ITestOutputHelper log)
1010
: IsolatedNuGetPackageFolderAspNetSdkBaselineTest(log, nameof(BlazorLegacyIntegrationTest60))
1111
{
1212

13-
protected override string EmbeddedResourcePrefix =>
13+
protected override string EmbeddedResourcePrefix =>
1414
string.Join('.', "Microsoft.NET.Sdk.BlazorWebAssembly.Tests", "StaticWebAssetsBaselines");
1515

1616
protected override string ComputeBaselineFolder() =>
1717
Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.BlazorWebAssembly.Tests", "StaticWebAssetsBaselines");
18-
18+
1919
[CoreMSBuildOnlyFact]
2020
public void Build60Hosted_Works()
2121
{

test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorMultitargetIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Microsoft.NET.Sdk.Razor.Tests;
4+
using Microsoft.NET.Sdk.StaticWebAssets.Tests;
55

66
namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tests
77
{

test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmBaselineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
using Microsoft.NET.Sdk.Razor.Tests;
4+
using Microsoft.NET.Sdk.StaticWebAssets.Tests;
55

66
namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tests
77
{

test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
</ItemGroup>
3737

3838
<ItemGroup>
39-
<Compile Include="..\Microsoft.NET.Sdk.Razor.Tests\AspNetSdkBaselineTest.cs" Link="AspNetSdkBaselineTest.cs" />
40-
<Compile Include="..\Microsoft.NET.Sdk.Razor.Tests\IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs" Link="IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs" />
41-
<Compile Include="..\Microsoft.NET.Sdk.Razor.Tests\StaticWebAssetsBaselineFactory.cs" Link="StaticWebAssetsBaselineFactory.cs" />
42-
<Compile Include="..\Microsoft.NET.Sdk.Razor.Tests\StaticWebAssetsBaselineComparer.cs" Link="StaticWebAssetsBaselineComparer.cs" />
39+
<Compile Include="..\Microsoft.NET.Sdk.StaticWebAssets.Tests\AspNetSdkBaselineTest.cs" Link="AspNetSdkBaselineTest.cs" />
40+
<Compile Include="..\Microsoft.NET.Sdk.StaticWebAssets.Tests\IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs" Link="IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs" />
41+
<Compile Include="..\Microsoft.NET.Sdk.StaticWebAssets.Tests\StaticWebAssetsBaselineFactory.cs" Link="StaticWebAssetsBaselineFactory.cs" />
42+
<Compile Include="..\Microsoft.NET.Sdk.StaticWebAssets.Tests\StaticWebAssetsBaselineComparer.cs" Link="StaticWebAssetsBaselineComparer.cs" />
4343
</ItemGroup>
4444

4545
<ItemGroup>

test/Microsoft.NET.Sdk.Razor.Tests/Microsoft.NET.Sdk.Razor.Tests.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<_Parameter2>5.0</_Parameter2>
3636
</AssemblyAttribute>
3737
</ItemGroup>
38-
38+
3939
<ItemGroup>
4040
<PackageReference Include="Microsoft.Build.Framework" />
4141
<PackageReference Include="Microsoft.Build.Utilities.Core" />
@@ -55,8 +55,6 @@
5555
<None Include="TestFiles\Generated\*.bundle.scp.css">
5656
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5757
</None>
58-
<EmbeddedResource Include="StaticWebAssetsBaselines\**">
59-
</EmbeddedResource>
6058
</ItemGroup>
6159

6260
<ItemGroup>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# C# files
2+
[*.cs]
3+
4+
#### Core EditorConfig Options ####
5+
6+
# var preferences
7+
csharp_style_var_elsewhere = true
8+
csharp_style_var_for_built_in_types = true
9+
csharp_style_var_when_type_is_apparent = true
10+
11+
# IDE0073: The file header does not match the required text
12+
dotnet_diagnostic.IDE0073.severity = error

test/Microsoft.NET.Sdk.Razor.Tests/AspNetSdkBaselineTest.cs renamed to test/Microsoft.NET.Sdk.StaticWebAssets.Tests/AspNetSdkBaselineTest.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Text.Json;
99
using Microsoft.AspNetCore.StaticWebAssets.Tasks;
1010

11-
namespace Microsoft.NET.Sdk.Razor.Tests
11+
namespace Microsoft.NET.Sdk.StaticWebAssets.Tests
1212
{
1313
[Trait("AspNetCore", "BaselineTest")]
1414
public class AspNetSdkBaselineTest : AspNetSdkTest
@@ -68,9 +68,9 @@ public AspNetSdkBaselineTest(ITestOutputHelper log, bool generateBaselines) : th
6868
private static StaticWebAssetsBaselineFactory CreateBaselineFactory() => StaticWebAssetsBaselineFactory.Instance;
6969

7070
protected virtual string ComputeBaselineFolder() =>
71-
Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.Razor.Tests", "StaticWebAssetsBaselines");
71+
Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.StaticWebAssets.Tests", "StaticWebAssetsBaselines");
7272

73-
protected virtual string EmbeddedResourcePrefix => string.Join('.', "Microsoft.NET.Sdk.Razor.Tests", "StaticWebAssetsBaselines");
73+
protected virtual string EmbeddedResourcePrefix => string.Join('.', "Microsoft.NET.Sdk.StaticWebAssets.Tests", "StaticWebAssetsBaselines");
7474

7575
public StaticWebAssetsManifest LoadBuildManifest(string suffix = "", [CallerMemberName] string name = "")
7676
{
@@ -324,4 +324,3 @@ private string Templatize(StaticWebAssetsManifest manifest, string projectRoot,
324324
}
325325
}
326326
}
327-

0 commit comments

Comments
 (0)