public ActionResult Index() { List <PersonViewModel> people = new List <PersonViewModel>(); people = service.ReadAll(); return(View(people)); }
public void RepositoryTestGetAll() { var mock = new Mock <IRepository <PDomain.Person> >(); mock.Setup(a => a.GetAll()).Returns(people); PersonServices service = new PersonServices(mock.Object); List <PersonViewModel> p = service.ToListViewModel(people); List <PersonViewModel> personResult = service.ReadAll(); Assert.AreEqual(p.ToString(), personResult.ToString()); }