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

My code here is not working
        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());