Trying to better my understanding of the MVC framework from Microsoft I begin stepping through the test cases. This perspective is one of the reasons I love TDD it is a good way to figure out what the code is supposed to do.
I believe that some of the test cases are not valid. Here is an example:
[TestMethod]
public void FindActionMethodDoesNotMatchProperty() { // FindActionMethod() shouldn't match special-named methods like property getters.
// Arrange
var controller = new FindMethodController();
ControllerContext context = GetControllerContext(controller);
ControllerActionInvokerHelper helper = new ControllerActionInvokerHelper(context);
// Act
MethodInfo mi = helper.PublicFindActionMethod("get_Property"); // Assert
Assert.IsNull(mi);
}
This is an example of testing the framework. When they do reflection to get the methods they do not ask for the properties. Is this a valid test ?
Right now I am going to go with no. It could be argued that they are making sure their code works as expected, but when you write code and ask for something specific i.e. (methods) how would you get back a property?
Have a good day
Bill