public void GetDescription_should_render_method_name_and_empty_arguments_list_when_call_has_no_arguments() { // Arrange var call = FakeCall.Create <object>("GetType"); // Act var description = call.GetDescription(); // Assert description.Should().Be("System.Object.GetType()"); }
public static FakeCall Create <T>(string methodName, Type[] parameterTypes, object[] arguments) where T : class { var method = typeof(T).GetMethod(methodName, parameterTypes); var call = new FakeCall { Method = method, Arguments = new ArgumentCollection(arguments, method), FakedObject = A.Fake <T>(), }; SequenceNumberManager.RecordSequenceNumber(call); return(call); }
private static FakeCall CreateFakeCallToFooDotBar(object argument1, object argument2) { return(FakeCall.Create <IFoo>("Bar", new[] { typeof(object), typeof(object) }, new[] { argument1, argument2 })); }
private static FakeCall CreateFakeCallToFooDotBar(object?argument1, object argument2) => FakeCall.Create <IFoo>(x => x.Bar(argument1, argument2));