public void CountTest() { //expected int expected = 1; bool called = false; Volary volary = new Volary(); VolaryStub volaryStub = new VolaryStub(); volary.volary = volaryStub; Mock.Arrange(() => volaryStub.Count()).DoInstead(() => called = true); // actual int actual = volary.Count(); Assert.AreEqual(expected, actual); }