我写单元测试,我有一些看起来像这样:FluentAssertions,确保了IEnumerable仅包含单元素
[Fact]
public void GetFoos_only_gets_foo1()
{
_foo1.included = true; //Foo object
_foo2.included = false; //Foo object
_sut.GetFoos().Should().OnlyContain(_foo1); // this doesn't work, is there a specific syntax to use?
}
而且GetFoos()
回报和IEnumberable<Foo>
你是什么意思 “不工作” 吗?请澄清问题 – Avery