示例#1
0
        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()");
        }
示例#2
0
        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);
        }
示例#3
0
 private static FakeCall CreateFakeCallToFooDotBar(object argument1, object argument2)
 {
     return(FakeCall.Create <IFoo>("Bar", new[] { typeof(object), typeof(object) }, new[] { argument1, argument2 }));
 }
示例#4
0
 private static FakeCall CreateFakeCallToFooDotBar(object?argument1, object argument2) =>
 FakeCall.Create <IFoo>(x => x.Bar(argument1, argument2));