Moq examples, Part II 6

Posted by Brett Schuchert Tue, 26 May 2009 02:57:00 GMT

A few blog articles ago I showed some examples using Moq. I created those examples in anticipation of using Moq in a TDD class with a group in Canada.

What I ended up creating was different for a number of reasons. The final version is somewhat cleaned up compared to those first examples, so here are those examples as well: actual test class created.

These tests are not really that different from the first version, other than I did not use exceptions as much.

After the underlying LoginService was created with these tests, I had the students refactor to the GoF State Design Pattern. If you’re feeling like a little practice, consider:
  • Creating one test at a time
  • Write the underlying service
  • When all tests are passing, try to refactor to the state pattern.

It’s a good exercise. The guys in Canada seemed to really grok Moq and started using it to characterize their actual code the next day.

Comments

Leave a response

  1. Avatar
    nike shoes hosting 6 months later:

    These tests are not really that different from the first version, other than I did not use exceptions as much.

  2. Avatar
    mod converter 8 months later:

    they both fit the code/

  3. Avatar
    mod converter 8 months later:

    so it is the status.

  4. Avatar
    http://www.emicsoft.com/shelleybj09@yahoo.com 10 months later:

    Studies serve for delight, for ornament, and for ability. Their chief use for delight, is in privateness and retiring; for

    ornament, is in discourse; and for ability, is in the judgment and disposition of business.

  5. Avatar
    FLV extractor 11 months later:

    just read the article

  6. Avatar
    han 11 months later:

    http://www.ipadvideoconverters.biz iPad Video Converter iPad Video Converter is a great software for iPad lovers to convert videos to iPad with super fast speed and high quality. Its easy-to-use interface makes iPad to videos conversion routine very simple. And also it can keep the original quality of video files.

Comments