public void Not_Equal__Throws_MethodNameException() { // Arrange var method = Substitute.ForPartsOf <MethodInfo>(); method.Name .Returns(Rnd.Str); var call = Substitute.For <ICall>(); call.GetMethodInfo() .Returns(method); // Act var action = () => FluentQueryHelper.AssertMethodName(call, Rnd.Str); // Assert Assert.Throws <MethodNameException>(action); }
public void Calls_GetMethodInfo__Asserts_Equal() { // Arrange var value = Rnd.Str; var method = Substitute.ForPartsOf <MethodInfo>(); method.Name .Returns(value); var call = Substitute.For <ICall>(); call.GetMethodInfo() .Returns(method); // Act var action = () => FluentQueryHelper.AssertMethodName(call, value); // Assert action(); call.Received().GetMethodInfo(); }