Beispiel #1
0
        public async Task Should_Return_Monitor_Details()
        {
            MockExternalLinks();

            var result = await _monitorService.GetMonitorDetailsAsync(2, 2);

            Assert.AreEqual("Test2", result.Name);
        }
Beispiel #2
0
        public async Task <IHttpActionResult> GetMonitorDetails(int monitorId)
        {
            try
            {
                var monitorDto = await _monitorService.GetMonitorDetailsAsync(GetUserAndOrganization().OrganizationId, monitorId);

                var monitorViewModel = _mapper.Map <MonitorDto, MonitorViewModel>(monitorDto);
                return(Ok(monitorViewModel));
            }
            catch (ValidationException e)
            {
                return(BadRequestWithError(e));
            }
        }