コード例 #1
0
        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);
        }
コード例 #2
0
        // GET: Complaint
        public ActionResult Index()
        {
            ComplaintListViewModel model = new ComplaintListViewModel()
            {
                Complaints = _complaintService.GetAll().OrderByDescending(x => x.CreatedDate).ToList()
            };

            return(View(model));
        }
コード例 #3
0
        public ActionResult Index()
        {
            var json = _complaintService.GetAll().ToMapJson();

            return(View(new MapModel()
            {
                MapData = json
            }));
        }
コード例 #4
0
        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")));
        }
コード例 #5
0
 public IActionResult Get()
 {
     return(Ok(_complaintService.GetAll()));
 }
コード例 #6
0
        public async Task <IActionResult> GetAll()
        {
            var complaint = await _complaintService.GetAll();

            return(Ok(complaint));
        }
コード例 #7
0
        public IActionResult GetComplaints()
        {
            var complaints = _complaintService.GetAll();

            return(Ok(complaints));
        }