示例#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());
 }