public void TryValidateModelEmptyBindingContextThrowsException() { // Arrange var controller = new TestableController(); var model = new TryValidateModelModel(); // Act & Assert var exception = Assert.Throws<InvalidOperationException>(() => controller.TryValidateModel(model)); Assert.Equal("The 'BindingContext' property of 'Microsoft.AspNet.Mvc.Controller' must not be null.", exception.Message); }