public void ViewNameFamily() { //Arrengue var repository = new Mock <IPeopleRepository>(); var person1 = new People { PersonId = 1, Name = "Orvile Simpson", Parent1Id = null, Parent2Id = null, Birthday = DateTime.MinValue }; var person2 = new People { PersonId = 2, Name = "Second", Parent1Id = 1, Parent2Id = null, Birthday = DateTime.MinValue }; List <People> persons = new List <People>(); persons.Add(person1); persons.Add(person2); repository.Setup(x => x.GetFamily(1)).Returns(persons); PeopleController controller = new PeopleController(repository.Object); // Act ViewResult result = controller.Family(2) as ViewResult; // Assert Assert.AreEqual("Family", result.ViewName); }