示例#1
0
        public ActionResult Index()
        {
            List <PersonViewModel> people = new List <PersonViewModel>();

            people = service.ReadAll();
            return(View(people));
        }
示例#2
0
        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());
        }