Avanade / UnitTestEx

UnitTestEx provides .NET testing extensions to the most popular testing frameworks (MSTest, NUnit and Xunit) specifically to improve the testing experience with ASP.NET controller, and Azure Function, execution including underlying HttpClientFactory mocking.
MIT License
18 stars 4 forks source link

Issue with Asserts? #51

Closed karpikpl closed 1 year ago

karpikpl commented 1 year ago

I have a following tests that passes with "UnitTestEx.Xunit" Version="2.1.1"

        // Arrange
        using var test = CreateApiTester<Startup>();

        // Act
        var result = test
            .Controller<SampleController>()
            .Run(c => c.Get("thisIsATest"))
            .AssertOK()
            .AssertJson("{\"data\": \"this_is_a_test\"}");

but this also passes and shouldn't

        // Act
        var result = test
            .Controller<SampleController>()
            .Run(c => c.Get("thisIsATest"))
            .AssertOK()
            .Assert(new { foo="bar"});
chullybun commented 1 year ago

Published NuGet package v2.1.2.

karpikpl commented 1 year ago

fix worked