public void GetPersentPresentStudentTest() { var presentcount = 5; var allCount = 15; _sps.Setup(a => a.GetAllcountPresentstudents()).Returns(presentcount); _sps.Setup(a => a.GetAllCountStudents()).Returns(allCount); var res = _teacher.GetPersentPresentStudent(); _sps.Verify(a => a.GetAllcountPresentstudents(), Times.Once); _sps.Verify(a => a.GetAllCountStudents(), Times.Once); var exp = 33.33; Assert.AreEqual(exp, res, 0.01); }