• Why Mocking Matters

    Wednesday, October 10, 2012 by Just* Team | Go comment!

    How does mocking benefit me?  That’s a question I hear a lot as I travel around the world giving talks.  So before we dive into how to use a mocking tool like JustMock, let’s discuss why this is important and the benefit that mocking provides over other techniques like Fakes.

    In my post on Why SOLID Matters, we refactored a small piece of code to be more SOLID.  Granted, it was a simplistic example, but good for illustrating several key points on SOLID.  We will continue using the same code to discuss the benefits of Mocking. 

    As a refresher, we ended...

  • Hot on the heels of the recently added support for QUnit and Jasmine JavaScript testing frameworks in JustCode, we have continued to evolve our Test Runner to make it even better. You will find many improvements in the latest version of JustCode in regard to running QUnit and Jasmine tests from within Visual Studio, and we’ve simplified the way you work with JustCode’s Test Runner to make it quicker and more convenient. Here is a detailed list of improvements: 

    • Jasmine and QUnit tests run faster
    • Support for any browser that is installed on your PC - Firefox, Chrome, Opera, IE, etc.
    • Choose to run QUnit and Jasmine...
  • As we showed in the Jasmine blog post JustCode provides seamless integration of JavaScript unit testing inside Visual Studio. JustCode supports two of the most widely used JavaScript unit testing frameworks – Jasmine and QUnit, allowing you to leverage the one that better fits your needs or both.

    Today’s post covers the support of QUnit JavaScript unit tests in JustCode.

    JQuery’s QUnit testing framework

    QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery project to test its code and plugins but is capable of testing any generic JavaScript code. In order to find out more about the framework and its capabilities please...

  • With every new release of JustCode we at Telerik are committed to providing you with the best tool for writing better, faster and error free code with ease. That of course includes testing it. With the latest and greatest version of JustCode we added support for two of the widely and most commonly used JavaScript testing frameworks out there - Jasmine and QUnit.

    In this post we will cover the support for Jasmine BDD JavaScript tests in JustCode.

    Industry first Jasmine support

    Jasmine is a behavior-driven development framework for testing your JavaScript code. For more information and details about the framework please visit Jasmine official site....

  • Come Join Us Hawaii

    Monday, March 28, 2011 by Phil Japikse | Go comment!

    I’m getting ready to kick off a crazy month of speaking.  I start Friday, April 1 in lovely Honolulu, HI with 4 talks at the Honolulu SQL (and .NET) Saturday.  I will be presenting:

    • Windows Presentation Foundation for Developers
    • Lessons Learned: Being Agile in a Waterfall Enterprise
    • Introduction to Test Driven Development
    • Mocks, Stubs, and Dependency Injection, Oh My!

    For more information, you can check out the conference at this link: http://www.sqlsaturday.com/72/eventhome.aspx

    Chris Eargle will also be there, presenting:

    • Code Like a Ninja: Enhance Your Productivity
    • Secrets of a .NET Ninja
    • What’s New in ASP.NET MVC3: Building Nerd Dinner

    I...

  • [Cross posted from www.skimedic.com/blog]

    Telerik’s JustCode natively supports several test runners, including MSpec. This is great - the JustCode product team has taken on the responsibility to make sure the test runner works with the test frameworks, letting the framework developers focus on building even more awesome frameworks!

    Occasionally, this can cause an issue, though, as we just discovered here at CodeMash. The latest rev of MSpec introduced breaking changes in the JustCode test runner. While the team is hard at work updating the test runner to be compatible with the latest api, the work around is very simple. Simply change the Copy...

  • [Cross Posted from http://www.skimedic.com/blog]

    Mocking Exceptions

    When writing unit tests, it is important to cover not only the successful execution path (commonly referred to as the “Happy” path), but also test the code that gets executed when things don’t go right (commonly referred to as the “Unhappy” path).  Testing for situations where services or databases are unavailable as well as erroneous user input are important aspects of ensuring quality in software.  Remember, if you don’t test it, your users will!

    We modify the LoginUser method to throw a custom exception when there is an exception is thrown from the LoginService.  To test this,...

  • [Cross Posted from http://www.skimedic.com/blog]

    Sequential Mocking

    One of the trickiest types of code to mock out for testing is recursive methods.  In a typical recursion, the same method is called multiple times, and each time there are typically different parameters passed in, and different return values.  To easily handle this, JustMock gives you two options:

    • Adding InSequence() to each arrange
    • Chaining Returns() calls together.

    To illustrate the first option, look at the following test:

    [Test]
    
    public void Show_Sequential_InSequence_Arrange_Option()
    
    {
    
        var service = Mock.Create<IService>();
    
        Mock.Arrange(() => service.GetSum(Arg.AnyInt, Arg.AnyInt))
    
                  .Returns(4).InSequence();
    
        Mock.Arrange(()...
Product Families