public void TeacherTest() { var teacherName = "Макаренко"; var result = _controller.Teacher(teacherName) as ViewResult; _teachersMock.Verify(item => item.GetByName(teacherName), Times.Once()); Assert.IsTrue(result.Model is TeachersSubjectsViewModel); var model = (TeachersSubjectsViewModel)result.Model; Assert.AreEqual(1, model.Subjects.Count); Assert.AreEqual("Алгебра", model.Subjects[0].Title); Assert.AreEqual(teacherName, model.Teacher.Name); }