예제 #1
0
        public void InvokeThenToUnit_14_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?, string, int, object?, DateTime, StructType?, decimal?, RefType, object, StructType, string, double, object?>();
            var action     = new Action <StructType, RefType?, string, int, object?, DateTime, StructType?, decimal?, RefType, object, StructType, string, double, object?>(mockAction.Object.Invoke);

            var arg1  = SomeTextStructType;
            var arg2  = (RefType?)null;
            var arg3  = TabString;
            var arg4  = MinusTwentyOne;
            var arg5  = new { Value = PlusOneHundredPointFive };
            var arg6  = Year2017March25H19Min31;
            var arg7  = (StructType?)null;
            var arg8  = (decimal?)MinusSeventyOnePointThree;
            var arg9  = ZeroIdRefType;
            var arg10 = new object();
            var arg11 = OtherTextStructType;
            var arg12 = SomeOtherText;
            var arg13 = PlusTwentyOnePointSeventyFive;
            var arg14 = (object?)null;

            var actual = action.InvokeThenToUnit(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14), Times.Once);
        }
예제 #2
0
        public void Invoke_15_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?, string, int, object?, DateTime, StructType?, decimal?, RefType, object, StructType, string, double, object?, string>();

            var arg1  = SomeTextStructType;
            var arg2  = (RefType?)null;
            var arg3  = TabString;
            var arg4  = MinusFortyFive;
            var arg5  = new { Value = PlusTwoHundredPointFive };
            var arg6  = Year2015March11H01Min15;
            var arg7  = (StructType?)null;
            var arg8  = (decimal?)MinusSeventyFivePointSeven;
            var arg9  = ZeroIdRefType;
            var arg10 = new object();
            var arg11 = CustomStringStructType;
            var arg12 = CustomText;
            var arg13 = PlusFortyOnePointSeventyFive;
            var arg14 = (object?)null;
            var arg15 = ThreeWhiteSpacesString;

            var actual = Unit.Invoke(mockAction.Object.Invoke, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15), Times.Once);
        }
예제 #3
0
        public void Invoke_00_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction();
            var actual     = Unit.Invoke(mockAction.Object.Invoke);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(), Times.Once);
        }
예제 #4
0
        public void Invoke_01_ExpectCallActionOnce(
            bool isArgNull)
        {
            var mockAction = MockActionFactory.CreateMockAction <RefType?>();

            var arg    = isArgNull ? null : MinusFifteenIdRefType;
            var actual = Unit.Invoke(mockAction.Object.Invoke, arg);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg), Times.Once);
        }
예제 #5
0
        public void Invoke_02_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?>();

            var arg1 = SomeTextStructType;
            var arg2 = (RefType?)null;

            var actual = Unit.Invoke(mockAction.Object.Invoke, arg1, arg2);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2), Times.Once);
        }
예제 #6
0
        public void InvokeThenToUnit_03_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?, string>();
            var action     = new Action <StructType, RefType?, string>(mockAction.Object.Invoke);

            var arg1 = SomeTextStructType;
            var arg2 = (RefType?)null;
            var arg3 = TabString;

            var actual = action.InvokeThenToUnit(arg1, arg2, arg3);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2, arg3), Times.Once);
        }
예제 #7
0
        public void Invoke_04_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?, string, int>();

            var arg1 = SomeTextStructType;
            var arg2 = (RefType?)null;
            var arg3 = TabString;
            var arg4 = MinusFortyFive;

            var actual = Unit.Invoke(mockAction.Object.Invoke, arg1, arg2, arg3, arg4);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2, arg3, arg4), Times.Once);
        }
예제 #8
0
        public void Invoke_06_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?, string, int, object?, DateTime>();

            var arg1 = SomeTextStructType;
            var arg2 = (RefType?)null;
            var arg3 = TabString;
            var arg4 = MinusFortyFive;
            var arg5 = new { Value = PlusTwoHundredPointFive };
            var arg6 = Year2015March11H01Min15;

            var actual = Unit.Invoke(mockAction.Object.Invoke, arg1, arg2, arg3, arg4, arg5, arg6);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2, arg3, arg4, arg5, arg6), Times.Once);
        }
예제 #9
0
        public void InvokeThenToUnit_05_ExpectCallActionOnce()
        {
            var mockAction = MockActionFactory.CreateMockAction <StructType, RefType?, string, int, object?>();
            var action     = new Action <StructType, RefType?, string, int, object?>(mockAction.Object.Invoke);

            var arg1 = SomeTextStructType;
            var arg2 = (RefType?)null;
            var arg3 = TabString;
            var arg4 = MinusTwentyOne;
            var arg5 = new { Value = PlusOneHundredPointFive };

            var actual = action.InvokeThenToUnit(arg1, arg2, arg3, arg4, arg5);

            Assert.AreEqual(Unit.Value, actual);
            mockAction.Verify(a => a.Invoke(arg1, arg2, arg3, arg4, arg5), Times.Once);
        }