• .NET

    Playing with aspx page cycle using JustMock

    In this post , I will cover a test code that will mock the various elements needed to complete a HTTP page request and  assert the expected page cycle steps. To begin, i have a simple enumeration that has my predefined page steps: public enum PageStep {     PreInit,     Load,     PreRender,     UnLoad } Once doing so, i  first created the page object [not mocking]. Page page = new Page(); Here, our target is to fire up the page process through ProcessRequest call, now if we take a look inside the method with reflector.net,  the call trace will go like : ProcessRequest –> ProcessRequestWithNoAssert –>...
    April 29, 2010
  • .NET

    JustCode – Color Identifiers in Depth

    Last time we looked at the basics of JustCode color identifiers. In this blog I will go a bit more in-depth about each of the available markers. There are quite a few, and we will be adding more as we mature JustCode.    What Do All of Those Markers DO? There are many markers listed in the “Display Item” list view, and you might not immediately know what some of these affect in the UI. That is why I have come up with this “cheat sheet” explaining each setting. Note: This code snippet contains at least one of every item JustCode colorizes. I turned off...
  • .NET

    JustCode – Color Identifier Basics

    Color identifiers make it easier for developers to quickly read and understand the code on screen.  One of the many features provided by JustCode is the ability to colorize additional items that Visual Studio does not allow you to colorize by default.  The colorization of items such as methods, properties, events, variables, and method parameters can easily be tweaked to your specific needs. Enable / Disable Color Identifiers In the recent release, we turned this option on by default.  You can enable/disable code colorization by going to the JustCode menu in Visual Studio, selecting options, then selecting the general section in...
  • .NET

    Working with multiple interfaces on a single mock.

    Today , I will cover a very simple topic, which can be useful in cases we want to mock different interfaces on our expected mock object.  Our target interface is simple and it looks like:   public interface IFoo : IDisposable {     void Do(); } Our target interface has an IDisposable implemented. Now, generally if we implement it in a class , we have to implement the whole of it [which is quite logical] and that should not wait for any extra calls or constructs. Considering that, when we are creating our target mock it should also implement all the dependent interfaces for us as well.   Therefore,  as we are creating...
    April 26, 2010
  • .NET

    Asserting with JustMock

    In this post, i will be digging in a bit deep on Mock.Assert. This is the continuation from previous post and covers up the ways you can use assert for your mock expectations.
    April 19, 2010