c# - In FluentAssertions, why is Should a method instead of a property? -
in fluentassertions, can make various claims in various formats.
x.should().beequivalentto(y); x.shouldbeequivalentto(y);
are both valid assertions.
why should
method , not property? haven't seen examples in should
takes parameter, seems me have been property.
you can assert that
x.should().notbenull().and.beequivalentto(y);
here, and
property instead of method. shouldn't and
, should
each same type of element (methods/properties)?
tl;dr there valid reason behind design choice make should
method in fluentassertions instead of property?
should()
extension method being added onto class of x
. can add extension methods -- c# doesn't have extension properties.
and
property on whatever class notbenull()
returns. there have control on class, , can add real properties it.
Comments
Post a Comment