public void ShouldReturnAListFromFindAll() { //arrange - act var list = _mockrepo.FindAll(); //assert Assert.AreEqual(4, list.Count()); }
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 }); } }
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 })); }