public void DispatchInteger_MultiplicationAndObjectList_CorrectValueReturned() { int expected = 17; MultiplicationExpression input1 = new MultiplicationExpression(null, null, 0, 0); List <Object> input2 = new List <Object>() { 23, 2.334, null }; IIntegerHelper ihelper = Substitute.For <IIntegerHelper>(); Interpreter interpreter = Utilities.GetIntepreterOnlyWith(ihelper); ihelper.MultiplicationInteger(Arg.Any <MultiplicationExpression>(), Arg.Any <List <Object> >()).Returns(expected); int res = interpreter.DispatchInt(input1, input2); Assert.AreEqual(expected, res); }
public void DispatchInteger_MultiplicationAndObjectList_CorrectListPassed() { List <Object> expected = new List <Object>() { 23, 2.334, null }; MultiplicationExpression input1 = new MultiplicationExpression(null, null, 0, 0); IIntegerHelper ihelper = Substitute.For <IIntegerHelper>(); Interpreter interpreter = Utilities.GetIntepreterOnlyWith(ihelper); List <Object> res = null; ihelper.MultiplicationInteger(Arg.Any <MultiplicationExpression>(), Arg.Do <List <Object> >(x => res = x)); interpreter.DispatchInt(input1, expected); res.Should().BeEquivalentTo(expected); }