• .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

    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...