public void TeacherTestGetAverage() { _markService.Setup(a => a.GetAllMarks(person)).Returns(_marks); double percentAverage = _teacher.GetAverage(person); _markService.Verify(a => a.GetAllMarks(person), Times.Once); Assert.AreEqual(86.0, percentAverage); }
public void TeacherGetAverageTest_5() { double exp = ((Student)_student1).marks.Average(); _markService.Setup(a => a.GetAverage(_student1)).Returns(exp); double currentresult = _teacher.GetAverage(_student1); _markService.Verify(a => a.GetAverage(_student1), Times.Once); Assert.AreEqual(exp, currentresult); }