Exemple #1
0
        public void TestImplementedMethod()
        {
            ///I don't understand why you need to use Mocking.Repository class.
            ///Isn't that an external reference?
            ///Creates a fake object of Repository
            ///The fake object is then stored into the Mock<Repository>
            var mock = new Mock <Repository>();
            //Passes the mock object that was created to the Business class
            //does not pass the Repository to access the methods
            Business business = new Business(mock.Object);

            //Test case using the mock object for the implemented method Sum
            Assert.AreEqual(4, business.Addition(2, 2));
        }