c# - How to exclude multiple properties in FluentAssertions ShouldBeEquivalentTo() -


using fluentassertions:
i'm able exclude single property using shouldbeequivalentto.

x.shouldbeequivalentto(y, opts => opts.excluding(si => !si.propertyinfo.canwrite)); 

but, how exclude more 1 property when using shouldbeequivalentto() ?

you 'll have use function instead of expression.

x.shouldbeequivalentto(y, excludeproperties);   private equivalencyassertionoptions<xx> excludeproperties(equivalencyassertionoptions<xx> options)     {             options.excluding(t => t.ceoperator);             options.excluding(t => t.ceoperatorname);             options.excluding(t => t.status);             options.excluding(t => t.isoperational);             return options;     } 

Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -