예제 #1
0
        public async Task <ActionResult <List <Case> > > Get()
        {
            List <Case> cases = await _repo.GetAllCases();

            if (cases == null)
            {
                return(NotFound());
            }
            return(cases);


            // TODO: Move this for possible future use
            // StringBuilder sb = new StringBuilder();

            // foreach (ActionDescriptor ad in _actionDescriptorCollectionProvider.ActionDescriptors.Items)
            // {
            //     var action = Url.Action(new UrlActionContext()
            //     {
            //         Action = ad.RouteValues["action"],
            //         Controller = ad.RouteValues["controller"],
            //         Values = ad.RouteValues
            //     });

            //     sb.AppendLine(action).AppendLine().AppendLine();
            // }

            // return Ok(sb.ToString());
        }
예제 #2
0
        public void CaseListIsNotEmpty()
        {
            ICaseRepository caseRepository = CaseRepository.Instance;

            caseRepository.Add(new Case());
            caseRepository.Add(new Case());

            List <ICase> listOfCases = caseRepository.GetAllCases();

            Assert.IsTrue(listOfCases.Count > 0);
        }
예제 #3
0
        public void CheckIfListHasCorrectNumberOfCases()
        {
            ICaseRepository caseRepository = CaseRepository.Instance;

            caseRepository.Add(new Case());
            caseRepository.Add(new Case());
            caseRepository.Add(new Case());

            List <ICase> listOfCases = caseRepository.GetAllCases();

            Assert.AreEqual(1, listOfCases.Count);
        }
예제 #4
0
        public IEnumerable <Cases> GetAllCases()
        {
            var result = _caseRepository.GetAllCases();

            return(result);
        }
예제 #5
0
 IEnumerable <Case> ICaseService.GetAllCases()
 {
     return(_caseRepository.GetAllCases());
 }
예제 #6
0
 public List <ICase> GetAllCases()
 {
     return(_caseRep.GetAllCases());
 }