ant-design-blazor/docs/test-kit.en-US.md
Patrick ba2c5e51d8 test: add TestKit for public tests (#1248)
* test: change folder structure and add new TestKit csproj for public testing of AntDesign-based applications

* docs: added CN and EN docs about TestKit

* fix doc translate

* change the directory structure

Co-authored-by: Patryk Grzelak <pgrzelak@mutate.app>
Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-04-04 21:37:06 +08:00

610 B

order title
7 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.

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>
        ");
    }
}