The TDD road continued .... again

by Lord Cod3n 24. September 2008 12:10

Please feel free to leave me comments on items you think could use some elaboration.

So in my attempt to multi-task (learn mvc, learn TDD) at the same time I was going through the test cases in MVC preview 5.  I found these videos which are excellent TDD and MVC videos.  The first video of the series can be found here:

http://www.asp.net/learn/mvc-videos/video-405.aspx 

The Video series is called MVC Pair Programming.

 

The one of the gentlemen in the video is the developer of the NUnit Testing Framework.  Very awesome videos if you guys ever browse my blog.

 

Code Happy,

Bill

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

MVC and TDD

by Lord Cod3n 23. September 2008 01:53

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

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

William Moore is the lead Software Architect and Technologist for Coden Enterprises. He has more than a decade of software development experience primarily Microsoft Platforms.  William enjoys the full gamit of coding everything from the UI down to the database.

Most comments

Page List