Example #1
0
        public void BindModelAsyncODataModelBinder_ThrowsArgumentNull_BindingContext()
        {
            // Arrange & Act & Assert
            ODataModelBinder binder = new ODataModelBinder();

            ExceptionAssert.ThrowsArgumentNull(() => binder.BindModelAsync(null), "bindingContext");
        }
Example #2
0
        public void BindModelAsyncODataModelBinder_ThrowsArgumentNull_ModelMetadata()
        {
            // Arrange
            ODataModelBinder           binder = new ODataModelBinder();
            Mock <ModelBindingContext> mock   = new Mock <ModelBindingContext>();

            mock.Setup(m => m.ModelState).Returns((ModelStateDictionary)null);

            // Act & Assert
            ExceptionAssert.ThrowsArgument(() => binder.BindModelAsync(mock.Object),
                                           "bindingContext", "The binding context cannot have a null ModelMetadata. (Parameter 'bindingContext')");
        }