-
-
Notifications
You must be signed in to change notification settings - Fork 382
Expand file tree
/
Copy pathBootstrapBlazorRootTest.cs
More file actions
33 lines (29 loc) · 1.06 KB
/
BootstrapBlazorRootTest.cs
File metadata and controls
33 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
//using HarmonyLib;
namespace UnitTest.Components;
public class BootstrapBlazorRootTest : TestBase
{
[Fact]
public void Render_Ok()
{
Context.Services.AddBootstrapBlazor();
Context.Services.AddScoped<IRootComponentGenerator, MockGenerator>();
Context.Services.GetRequiredService<ICacheManager>();
var cut = Context.Render<BootstrapBlazorRoot>();
cut.Contains("<div class=\"auto-generator\"></div>");
}
class MockGenerator : IRootComponentGenerator
{
/// <summary>
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
public RenderFragment Generator() => builder =>
{
builder.AddContent(0, new MarkupString("<div class=\"auto-generator\"></div>"));
};
}
}