public void Post_valid_data_returns_created_at_route()
        {
            // arrange
            var validViewModel = new TransportRuleVM();
            // act
            var result = _controller.Post(validViewModel);

            //assert
            Assert.IsInstanceOfType(result.Result, typeof(CreatedAtActionResult));
        }
        public void Put_invalid_data_returns_bad_request()
        {
            // Arrange
            var invalidViewModel = new TransportRuleVM();

            _controller.ModelState.AddModelError("key", "Required");
            // Act
            var result = _controller.Put(invalidViewModel.id, invalidViewModel);

            // Assert
            Assert.IsInstanceOfType(result.Result, typeof(BadRequestObjectResult));
        }
        public void Post_valid_data_returns_new_record_in_data_object()
        {
            // arrange
            var validViewModel = new TransportRuleVM();
            // act
            var result            = _controller.Post(validViewModel).Result as ObjectResult;
            var returnedViewModel = UnitTestExtensions.ExtractFromDataObject <TransportRuleVM>(result?.Value);

            //assert
            Assert.IsInstanceOfType(returnedViewModel, typeof(TransportRuleVM));
            Assert.IsTrue(UnitTestExtensions.HasDataProperty(result));
        }