Example #1
0
        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));
        }
Example #4
0
        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);
        }
Example #5
0
        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)));
        }
Example #7
0
 public Module Get(string name)
 {
     return(ModuleRepository
            .GetAll(r => r.Name == name && !r.IsDeleted)
            .FirstOrDefault());
 }
Example #8
0
 public List <Module> GetAll()
 {
     return(ModuleRepository
            .GetAll(r => !r.IsDeleted).ToList());
 }