public void DispatchInteger_DivisionAndObjectList_CorrectValueReturned() { int expected = 17; DivisionExpression input1 = new DivisionExpression(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.DivisionInteger(Arg.Any <DivisionExpression>(), Arg.Any <List <Object> >()).Returns(expected); int res = interpreter.DispatchInt(input1, input2); Assert.AreEqual(expected, res); }
public void DispatchInteger_DivisionAndObjectList_CorrectListPassed() { List <Object> expected = new List <Object>() { 23, 2.334, null }; DivisionExpression input1 = new DivisionExpression(null, null, 0, 0); IIntegerHelper ihelper = Substitute.For <IIntegerHelper>(); Interpreter interpreter = Utilities.GetIntepreterOnlyWith(ihelper); List <Object> res = null; ihelper.DivisionInteger(Arg.Any <DivisionExpression>(), Arg.Do <List <Object> >(x => res = x)); interpreter.DispatchInt(input1, expected); res.Should().BeEquivalentTo(expected); }