コード例 #1
0
        public void Should_Return_Monitor_Details()
        {
            MockExternalLinks();

            var result = _monitorService.GetMonitorDetails(2, 2);

            Assert.AreEqual("Test2", result.Name);
        }
コード例 #2
0
        public async Task <IActionResult> AllLine()
        {
            var monitorDetails = await _monitorService.GetMonitorDetails();

            var viewModel = new MonitorViewModel
            {
                MonitorDetails = monitorDetails
            };

            return(View());
        }
コード例 #3
0
 public IHttpActionResult GetMonitorDetails(int monitorId)
 {
     try
     {
         var monitorDTO       = _monitorService.GetMonitorDetails(GetUserAndOrganization().OrganizationId, monitorId);
         var monitorViewModel = _mapper.Map <MonitorDTO, MonitorViewModel>(monitorDTO);
         return(Ok(monitorViewModel));
     }
     catch (ValidationException e)
     {
         return(BadRequestWithError(e));
     }
 }