Telerik blogs
  • Productivity

    Mocking MessageBox.Show with JustMock

    Using JustMock Commercial Edition you can easily mock out calls to MessageBox.Show().  This can come in handy if you are testing code that bases its execution path on a MessageBox’s result. Also, it is unlikely you want the MessageBox to actually pop up while running your tests.  Let’s see how we can accomplish this!  The Basics [TestMethod] public void MOCK_MESSAGEBOX_RESULT() { bool called = false; DialogResult expected =...
    April 21, 2011
  • Release

    JustCode Q1 2011 Service Pack 1 is out

    A month after the successful JustCode Q1 release we are ready with a new wave of improvements – Q1 2011 SP1. You can download it directly from Visual Studio through the JustCode Auto Updates or get it from telerik.com. Highlights for the Service Pack: Performance optimizations – startup performance, solution load performance, memory consumption, etc.; New Generate ToString() feature; A ton of other fixes and improvements (more info in the full release notes). As always for the service pack we focused on fixing reported issues. Additionally we were able to squeeze in some nice improvements that should make your just-coding experience a better one. In the same time...
    April 19, 2011
  • Productivity

    Mocking constructor part 2

    Often we end up in a situation where constructor call on the target type requires us to include  a config file in our test project or requires firing up some external process. To better illustrate this if we create an entity framework data container either new or from an existing database , we will likely to end up with an entry point class that requires either a valid connection string to be passed or if we expand the default constructor we might see this:   /// <summary> /// Initializes a new NorthwindEntities object using the connection string found in the 'NorthwindEntities' section of the application...
    March 22, 2011
  • Productivity

    Working with Mock Behaviors in JustMock

    When you create a mock using Mock.Create<> or Mock.Create there are three Behavior modes available. Each one causes the mock to behave in very different ways. For those of you new to mocking, you may not know at first what each of these behaviors mean
    March 18, 2011