mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
23 lines
610 B
Markdown
23 lines
610 B
Markdown
|
---
|
||
|
order: 7
|
||
|
title: TestKit
|
||
|
---
|
||
|
|
||
|
You can use the TestKit package in order to create a BUnit test context dervied from `AntDesignTestBase`.
|
||
|
|
||
|
This will add the required AntDesign services to the test context so that you can create unit tests.
|
||
|
|
||
|
|
||
|
```cs
|
||
|
public class ButtonTests : AntDesignTestBase
|
||
|
{
|
||
|
[Fact]
|
||
|
public void Renders_an_empty_button()
|
||
|
{
|
||
|
var cut = Context.RenderComponent<AntDesign.Button>();
|
||
|
cut.MarkupMatches(@"
|
||
|
<button class=""ant-btn ant-btn-default"" id:ignore type=""button"" ant-click-animating-without-extra-node=""false""></button>
|
||
|
");
|
||
|
}
|
||
|
}
|
||
|
```
|