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

c# SetCompatibleTextRenderingDefault must be called before the first -

c++ - Fill runtime data at compile time with templates -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -