Exemplo n.º 1
0
        public void UpdateShouldReturnBadRequestWithInvalidModel()
        {
            this.flightsController.Configuration = new HttpConfiguration();

            var invalidModel = TestObjectFactoryDataTransferModels.GetInvalidUpdateFlightRequestModel();

            this.flightsController.Validate(invalidModel);

            var result = this.flightsController.Update(Constants.ENTITY_VALID_ID, invalidModel);

            Assert.AreEqual(typeof(InvalidModelStateResult), result.GetType());
        }
Exemplo n.º 2
0
        public void UpdateShouldValidateModelState()
        {
            this.flightsController.Configuration = new HttpConfiguration();

            var invalidModel = TestObjectFactoryDataTransferModels.GetInvalidUpdateFlightRequestModel();

            this.flightsController.Validate(invalidModel);

            var result = this.flightsController.Update(Constants.ENTITY_VALID_ID, invalidModel);

            Assert.IsFalse(this.flightsController.ModelState.IsValid);
        }