vendredi 16 octobre 2015

Can NSubstitute check calls that take an Expression

I'm trying to validate a call to a method that takes a parameter of type Expression<Func<T, U>>, but I'm not able to get NSubstitute to recognize it.

I've tried:

// this fails to compile
myObj.Received(1).DoThing(Arg.Is(10), Arg.Any<Expression<Func<MyClassType, long>>>());

// this compiles, but the Received check looks for the first arg to be 0 instead of 10
// and the second arg doesn't match even though the types are correct
myObj.Received(1).DoThing(Arg.Is(10), x => x.Property);





Aucun commentaire:

Enregistrer un commentaire