• .NET

    Mocking Property Getters and Setters

    In typical unit testing scenarios, mocking property getters and setters isn't high on the list of areas of concern. Where it usually comes into play is when an entity’s properties’ values (or the act of setting them) are part of the scaffolding, or behavior for the system under test.
    December 27, 2012
  • .NET

    Mocking Constructors with JustMock

    In .NET there are two types of constructors, instance constructors and static constructors. Instance constructors are called when objects are instantiated, while static constructors get called before any member of the class is invoked for the first time.
    December 13, 2012
  • .NET

    Slides, Source Code and Video to the “Getting Started with JustMock” Webinar Now Available

    Chris and I wanted to thank you all for attending the “Getting Started with JustMock” webinar. The slides, source code and recorded video are now available for you to explore. If you have any questions, then feel free to leave a comment below or send us an email/tweet. I encourage you to go ahead and download your own copy of JustMock and start experiencing Fast, Fluid Unit Testing for yourself. WEBINAR MATERIALS Slides, Source Code and the Recorded Webinar Video is now available for you to enjoy.
    December 06, 2012
  • .NET

    Automocking with JustMock

    Auto mocking containers are designed to reduce the friction of keeping unit test beds in sync with the code being tested as systems are updated and evolve over time. Background The Dependency Inversion Principle states: High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions. As more developers follow this and the rest of Robert Martin’s SOLID principles, methods and classes become much smaller with dependent objects injected into them, typically through constructor injection. As additional dependencies are needed (or the code is refactored to improve dependency isolation), the signatures of...
    November 07, 2012
  • .NET

    Abstracting Dependencies with JustMock

    Unit tests are most effective when the System Under Test is isolated from its dependencies.  The best way to isolate your code (and make your code more SOLID) is through dependency injection. But even if you follow the rules of SOLID and inject all of the necessary dependencies in as interfaces, you are still faced with the fact that you depend on them. In order to test your code, something concrete has to be passed into the code in order for it to even compile.  Your production code will most likely use a factory to create concrete instances of the dependent interfaces, but that...
    October 31, 2012