Пример #1
0
        public void CreateAirport_WhenDataIsIncorrect_CheckException()
        {
            AirportDTO.Name = null;

            var response = AirportController.CreateAirport(AirportDTO);

            Assert.IsNotNull(response);
            Assert.AreEqual(response.Result.GetType().Name, "ResponseMessageResult");
        }
Пример #2
0
        public void Create_WhenDataIsIncorrect_CheckModelStateInvalid()
        {
            AirportDTO.Name = null;

            AirportController.Validate(AirportDTO);

            var result = AirportController.CreateAirport(AirportDTO);

            Assert.AreEqual(result.Result.GetType().Name, "InvalidModelStateResult");
        }
Пример #3
0
        public void CreateAirport_WhenDataIsCorrect_CheckCreateOneAirport()
        {
            TestEnvironmentManager.DeleteAirportTest(AirportService, AirportDTO.Name);

            var response = AirportController.CreateAirport(AirportDTO);

            Assert.IsNotNull(response);
            Assert.AreEqual(response.Result.GetType().Name, "OkNegotiatedContentResult`1");

            TestEnvironmentManager.DeleteAirportTest(AirportService, AirportDTO.Name);
        }