This project is read-only.

How to Expect and Assert a method without return?

Apr 17, 2015 at 4:01 AM
Edited Apr 17, 2015 at 7:19 AM
How to Expect and Assert a Method without return? Thanks
(mis.mock.SetNumber(10)

My code here is not working
 [TestMethod]
        public void TestSampleOrdered()
        {
            MockFactory mf = new MockFactory();
            Mock<ISample> mis = mf.CreateMock<ISample>();

            using (mf.Ordered())
            {
                mis.Expects.One.Method(a => a.GetNumber()).WillReturn(1);
                mis.Expects.One.Method(a => a.SetNumber(10));
            }

            Assert.AreEqual(1, mis.MockObject.GetNumber());
           mis.MockObject.SetNumber(10);
        }