public void MathTest() { var mock = new Mock<IMathClass>(); mock.Setup(s => s.Sum(1, 10)).Returns(10); Console.Write("{0}", mock.Object.Sum(1, 10)); //Actual Object var obj = new MathClass(); Console.Write("{0}", obj.Sum(1, 10)); }
public void MathTest() { var mock = new Mock <IMathClass>(); mock.Setup(s => s.Sum(1, 10)).Returns(10); Console.Write("{0}", mock.Object.Sum(1, 10)); //Actual Object var obj = new MathClass(); Console.Write("{0}", obj.Sum(1, 10)); }