• .NET

    JustMock. The tale continues... (Part 2)

    [Want to see JustMock in action? Register for the free webinar this Thursday, Jul 22, 11 am EST and check out What’s New in JustCode, JustMock, and OpenAccess ORM. During the live event attendees will also have the chance to win a Telerik Ultimate Collection (valued at $1999).]   In JustMock. The tale continues... (Part 1) we saw how we can inject prologue/epilogue code in .NET methods with JustMock. We covered the most simplest scenarios and some more complex ones as methods with ref/out parameters. Today I will show you how to do code injections in generic methods.Basically there is nothing new. We are already familiar with: AtStartOfAction AtStartOfFunc AtEndOfAction AtEndOfFunc etc. and last time...
  • .NET

    JustMock. The tale continues... (Part 1)

    Last time we talked about how to inject code at the beginning of a method. Today I will post how to inject code at the end of a method and I will cover some more complex scenarios as well. So lets start with sample program and then I will explain it in details. using System; using Telerik.CodeWeaver.Hook;   namespace ConsoleApplication2 {     sealed class MyClass     {         public void SayHello() { Console.WriteLine("Hello!"); }           public int SayHello(string name)         {             Console.WriteLine("Hello {0}!", LastName = name);             return (name ?? string.Empty).Length;         }           public string LastName { get; set; }           public int Increment10(ref int...
  • .NET

    Calling a method of a base class' base class

    July 09, 2010 Share
    Yesterday a colleague of mine asked me a question about how to invoke a method of a base class' base class. Although it is possible it is not a good idea.
  • .NET

    JustMock. Not just mock. A tale about duality.

    As JustMock is approaching its release date I decided to blog about it and more precisely about its dual nature. Probably you already know JustMock supports two (proxy and elevated) modes. That's why I am speaking about duality. In fact the duality in JustMock has many aspects. We could even say JustMock was built on two continents as one of the brains behind JustMock is working remotely on the project. So, duality is everywhere :) By the way, check out Mehfuz's blog, it is excellent place where you can see JustMock in action. I've been thinking for some time about doing...
  • .NET

    Hands on mocking of ASPNETMVC controller action

    June 23, 2010 Share
    In this post, I will start with an MVC sample created from the default template project that is bundled with ASPNET MVC2 installation. This template provides not just a dummy project with folder organized but rather a full running app.