Telerik blogs
  • Productivity

    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
  • Productivity Testing

    Getting Started with NUnit, NUnit.Should, and JustMock

    Technorati Tags: TDD,Test Driven Development,JustMock,JustCode,NUnit,NUnit.Should,Mocking Before diving into mocking with JustMock, it’s important to note that JustMock is a mocking framework, and not a testing framework.  Test frameworks allow for creating Test Fixtures, which are .NET classes decorated with the appropriate attributes so they are picked up by a Test Runner.  Test are created within a Test Fixture by writing methods (with the appropriate attributes) that exercise your code (also referred to as the System Under Test) and report the results.  Test Runners are programs that will run your tests.  There are many free testing frameworks available for .NET developers, including MSTest (included...
    October 05, 2012
  • Productivity

    Why I Hate Unit Testing

    So you went to work for the cool company that wooed you with promises of cutting edge technologies and techniques. In the interview, they told you that they are agile and unit test everything. You may or may not have been in an agile environment before, but the important thing you are enthusiastic about joining a team that truly gets software development. You tested on your previous job, even using JustMock to write better tests. You promise you can be agile yourself and quickly adopt their practices. You’re immediately hired. Many of you have been there… maybe you’re there right now. It takes...
  • Productivity

    Mocking the File System to Improve Testability (with JustMock)

    Many applications require access to the file system to create, modify or delete files and folders. But how do you make sure that such application behaves correctly? You do it with tests of course but there is a catch: In general it is not a good idea to have tests that are performing Input/Output operations like accessing files and databases. When you need to test I/O operations mock objects are your friend. And before I go into more details let me point out some of the benefits of mocking. Usually faster than performing I/O operations You do not have have to deal...
  • Productivity Testing

    Mock. Just Mock. JustMock.

    It's my pleasure to announce the newest member of the Telerik product family – JustMock . We’re about to release the first beta of this new product on the 12th of April and the first official version is expected to be part of the Q2 release. Except JustMock, there’re some other big announcements we’re going to make on the 12th of April so please, stay tuned. This is just announcement 1/3. JustMock, as can be inferred from its name, is a mocking tool that will help you create better unit tests by making it easier for you to create mock objects (http://en.wikipedia.org/wiki/Mock_object)...
    April 06, 2010