Skip to content

Commit a9eb67f

Browse files
committed
test: 增加 IsWasm 单元测试
1 parent 8b588e8 commit a9eb67f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
using Microsoft.Extensions.FileProviders;
7+
using Microsoft.Extensions.Hosting;
8+
9+
namespace UnitTest.Extensions;
10+
11+
public class HostEnvironmentExtensionsTest
12+
{
13+
[Fact]
14+
public void IsWasm_Ok()
15+
{
16+
var hostEnvironment = new MockWasmHostEnvironment();
17+
Assert.False(hostEnvironment.IsWasm());
18+
}
19+
20+
class MockWasmHostEnvironment : IHostEnvironment
21+
{
22+
public string EnvironmentName { get; set; } = "Development";
23+
24+
public string ApplicationName { get; set; } = "BootstrapBlazor";
25+
26+
public string ContentRootPath { get; set; } = "";
27+
28+
public IFileProvider ContentRootFileProvider { get; set; } = null!;
29+
}
30+
}

0 commit comments

Comments
 (0)