public void It_should_ask_the_complaint_service_for_all_complaints()
        {
            //arrange

            //act
            _controller.Index();

            //assert
            A.CallTo(() => _complaintService.GetAll(A <Expression <Func <Complaint, bool> >[]> .That.IsSameSequenceAs(TestUtilities.EmptyComplaintFilters()))).MustHaveHappened(Repeated.Exactly.Once);
        }
        // GET: Complaint
        public ActionResult Index()
        {
            ComplaintListViewModel model = new ComplaintListViewModel()
            {
                Complaints = _complaintService.GetAll().OrderByDescending(x => x.CreatedDate).ToList()
            };

            return(View(model));
        }
        public ActionResult Index()
        {
            var json = _complaintService.GetAll().ToMapJson();

            return(View(new MapModel()
            {
                MapData = json
            }));
        }
        public IHttpActionResult Get()
        {
            complaintService = new ComplaintService();
            var complaints = complaintService.GetAll();

            if (complaints != null)
            {
                var complaintEntities = complaints as List <ComplaintView> ?? complaints.ToList();
                if (complaintEntities.Any())
                {
                    return(Ok(complaintEntities));
                }
            }
            return(Content(HttpStatusCode.NotFound, APIMessageHelper.ListNotFoundMessage("Complaints")));
        }
Example #5
0
 public IActionResult Get()
 {
     return(Ok(_complaintService.GetAll()));
 }
        public async Task <IActionResult> GetAll()
        {
            var complaint = await _complaintService.GetAll();

            return(Ok(complaint));
        }
        public IActionResult GetComplaints()
        {
            var complaints = _complaintService.GetAll();

            return(Ok(complaints));
        }