Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/UnitTestEditor/BootstrapBlazorTestBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

Expand All @@ -9,13 +9,13 @@ namespace UnitTestEditor;

public class BootstrapBlazorTestBase : IDisposable
{
protected TestContext Context { get; }
protected BunitContext Context { get; }

protected ICacheManager Cache { get; }

public BootstrapBlazorTestBase()
{
Context = new TestContext();
Context = new BunitContext();
Context.JSInterop.Mode = JSRuntimeMode.Loose;

ConfigureServices(Context.Services);
Expand Down
12 changes: 6 additions & 6 deletions test/UnitTestEditor/EditorTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

Expand All @@ -12,7 +12,7 @@ public class EditorTest : BootstrapBlazorTestBase
public async Task Editor_Ok()
{
var value = new Foo();
var cut = Context.RenderComponent<Editor>(pb =>
var cut = Context.Render<Editor>(pb =>
{
pb.Add(a => a.Value, value.Name);
pb.Add(a => a.ValueChanged, v => value.Name = v);
Expand All @@ -23,7 +23,7 @@ public async Task Editor_Ok()
await cut.InvokeAsync(() => cut.Instance.Update("Test"));
Assert.Equal("Test", value.Name);

cut.SetParametersAndRender(pb =>
cut.Render(pb =>
{
pb.Add(a => a.OnValueChanged, v =>
{
Expand All @@ -39,7 +39,7 @@ public async Task Editor_Ok()
[Fact]
public async Task CustomerToolbarButtons_Ok()
{
var cut = Context.RenderComponent<Editor>(pb =>
var cut = Context.Render<Editor>(pb =>
{
pb.Add(a => a.Value, "Test");
pb.Add(a => a.CustomerToolbarButtons, new EditorToolbarButton[]
Expand All @@ -65,7 +65,7 @@ public async Task CustomerToolbarButtons_Ok()
Assert.Equal("Tooltip1", toolbarButtons!.First().Tooltip);

var name = "";
cut.SetParametersAndRender(pb =>
cut.Render(pb =>
{
pb.Add(a => a.OnClickButton, v =>
{
Expand All @@ -80,7 +80,7 @@ public async Task CustomerToolbarButtons_Ok()
[Fact]
public async Task DoMethodAsync_Ok()
{
var cut = Context.RenderComponent<Editor>(pb =>
var cut = Context.Render<Editor>(pb =>
{
pb.Add(a => a.Value, "Test");
});
Expand Down
4 changes: 2 additions & 2 deletions test/UnitTestRegion/ServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

Expand All @@ -19,7 +19,7 @@ public void GetCities_Ok()
Assert.Equal(34, provinces.Count);

var cities = regionService.GetCities("北京市");
Assert.Empty(cities);
Assert.Single(cities);

cities = regionService.GetCities("河北省");
Assert.Equal(11, cities.Count);
Expand Down
Loading