public async Task GetAll_ReturnsAllModules() { // arrange & act var modules = await _moduleRepository.GetAll(); Assert.NotEmpty(modules); Assert.Contains(modules, m => m.Id == -1); }
public void CleanUp() { Module[] modules = Repository.GetAll(); foreach (Module module in modules) { Repository.Remove(module); } }
public ActionResult Modules() { ModuleRepository repo = new ModuleRepository(); List <Models.Module> lstReturn = repo.GetAll(); return(Json(lstReturn, JsonRequestBehavior.AllowGet)); }
public List <ModuleListModel> GetAllModules() { List <ModuleListModel> listPlanModules = moduleRepository.GetAll(x => x.IsPlanModule == true).Select(y => new ModuleListModel { ModuleId = y.ModuleId, ModuleName = y.ModuleName }).ToList(); return(listPlanModules); }
public void Should_return_all_modules() { using (var context = new WeapsyDbContext(_contextOptions)) { var repository = new ModuleRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper()); var modules = repository.GetAll(); Assert.AreEqual(2, modules.Count); } }
public async Task <ActionResult <IEnumerable <ModuleDto> > > GetModules() { var modules = await _moduleRepository.GetAll(); return(Ok(_mapper.Map <IEnumerable <ModuleDto> >(modules))); }
public Module Get(string name) { return(ModuleRepository .GetAll(r => r.Name == name && !r.IsDeleted) .FirstOrDefault()); }
public List <Module> GetAll() { return(ModuleRepository .GetAll(r => !r.IsDeleted).ToList()); }