public void Should_Return_Monitor_Details() { MockExternalLinks(); var result = _monitorService.GetMonitorDetails(2, 2); Assert.AreEqual("Test2", result.Name); }
public async Task <IActionResult> AllLine() { var monitorDetails = await _monitorService.GetMonitorDetails(); var viewModel = new MonitorViewModel { MonitorDetails = monitorDetails }; return(View()); }
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)); } }