コード例 #1
0
        public async void ValidPersonel_ReturnsNotFound()
        {
            var controller = new GenericSystemsController(_genericSystemService, _personnelService);

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = HttpContexts.Valid_Search;

            var response = await controller.GetPersonnel("5a8417f68317338c8e080a63");

            Assert.IsType <NotFoundObjectResult>(response);

            var notFoundResult = response as NotFoundObjectResult;

            Assert.Equal(404, notFoundResult.StatusCode);
        }
コード例 #2
0
        public async void ValidSystem_ReturnsOk()
        {
            var controller = new GenericSystemsController(_genericSystemService, _personnelService);

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = HttpContexts.Valid_Search;

            var response = await controller.Get("5a8417338317338c8e0809e5");

            Assert.IsType <OkObjectResult>(response);

            var okResult = response as OkObjectResult;

            Assert.Equal(200, okResult.StatusCode);

            var responseContent = okResult.Value;

            Assert.IsType <GenericSystemViewModel>(responseContent);
            var viewModel = responseContent as GenericSystemViewModel;

            Assert.Equal("Ambulance Service Call Handler", viewModel.Name);
            Assert.Equal("200000000115", viewModel.Asid);
        }
コード例 #3
0
        public async void ValidPersonel_ReturnsOk()
        {
            var controller = new GenericSystemsController(_genericSystemService, _personnelService);

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = HttpContexts.Valid_Search;

            var response = await controller.GetPersonnel("5a8417f68317338c8e080a62");

            Assert.IsType <OkObjectResult>(response);

            var okResult = response as OkObjectResult;

            Assert.Equal(200, okResult.StatusCode);

            var responseContent = okResult.Value;

            Assert.IsType <PersonnelViewModel>(responseContent);
            var viewModel = responseContent as PersonnelViewModel;

            Assert.Equal("999 Call Handler", viewModel.Name);
            Assert.Equal("CModule-Type", viewModel.CModule);
        }