-
-
Notifications
You must be signed in to change notification settings - Fork 383
Expand file tree
/
Copy pathTestBase.cs
More file actions
24 lines (20 loc) · 745 Bytes
/
TestBase.cs
File metadata and controls
24 lines (20 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 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
namespace UnitTest.Core;
public class TestBase : IDisposable
{
protected BunitContext Context { get; }
public TestBase()
{
Context = new BunitContext();
Context.JSInterop.Mode = JSRuntimeMode.Loose;
}
public void Dispose()
{
// 由于 bUnit 2.0 继承了 IAsyncDisposable 接口,因此此处调用 DisposeAsync 方法
Context.DisposeAsync().AsTask().Wait();
GC.SuppressFinalize(this);
}
}