public void ShouldReturnAListFromFindAll()
        {
            //arrange - act
            var list = _mockrepo.FindAll();

            //assert
            Assert.AreEqual(4, list.Count());
        }
Example #2
0
 public void initRole(User model)
 {
     model.ListRole = new List <Role>();
     foreach (Context.Role item in RepoRole.FindAll())
     {
         model.ListRole.Add(new Role()
         {
             id = item.Id, name = item.RoleName, isselect = false
         });
     }
 }
Example #3
0
        public string Binding()
        {
            List <Context.Role> items = RepoRole.FindAll();

            List <Role> ListModel = new List <Role>();

            foreach (Context.Role item in items)
            {
                ListModel.Add(new Role(item));
            }

            return(new JavaScriptSerializer().Serialize(new { total = ListModel, data = ListModel }));
        }