What's the idiomatic way to verify collection size in xUnit?

前端 未结 5 571
遥遥无期
遥遥无期 2021-02-06 20:25

I have in my test suite a test that goes something like this:

[Fact]
public void VerifySomeStuff()
{
    var stuffCollection = GetSomeStuff();

    Assert.Equal(         


        
5条回答
  •  忘了有多久
    2021-02-06 20:32

    I found this give me the same error:

    Assert.Equal(2, vm.Errors.Count());
    

    And casting it stopped the error from appearing.

    Assert.Equal(2, (int)vm.Errors.Count());
    

提交回复
热议问题