Browse Blog Posts by Tags

Showing related tags and posts for the Blogs application. See all tags in the site
  • Mscorlib mocking minus the attribute

    Mocking .net framework members (a.k.a. mscorlib) is always a daunting task. It’s the breed of static and final methods and full of surprises. Technically intercepting mscorlib members is completely different from other class libraries. This is the reason it is dealt differently. Generally, I prefer writing...
    Posted to Mehfuz's Log by on Mon, Jul 9 2012
    Filed under: Filed under: , , , ,
  • Fake a member without worrying about passing the dependency

    I have came across this several times in forum (telerik) on how I can really fake an item yet I don’t want to pass the instance as an argument. Ideally, this is not a best design but there are third- partly libraries that you have little control over how its written.  Anyway, whatever the case might...
    Posted to Mehfuz's Log by on Thu, Jul 21 2011
    Filed under: Filed under: , ,
  • Mocking constructor

    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...
    Posted to Mehfuz's Log by on Tue, Mar 22 2011
    Filed under: Filed under: , , ,
  • How to raise event for a mocked call.

    Recently, while i was working with a support issue , i found this interesting piece of test code that i would like to share here. This is actually written by Stefan Lieser (Out from German .net community forwarded to me by Jan from Telerik Germany). As the title states,  it is to mock a specific...
    Posted to Mehfuz's Log by on Wed, Oct 6 2010
    Filed under: Filed under: , ,
  • Back to school : Getting to know F#

    This post starts with a basic introduction of F# and finally ends up writing a simple unit test for an F# member. For those who don’t know what F# is all about, Its a product from Microsoft research and now part of VS 2010 family. Actually from Wikipedia it is described as follows: F# (pronounced F Sharp...
    Posted to Mehfuz's Log by on Fri, Aug 13 2010
    Filed under: Filed under: , , ,
  • Hands on mocking of ASPNETMVC controller action

    In this post, i will start with a 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.The target of this post is to show a mocking of a controller action...
    Posted to Mehfuz's Log by on Wed, Jun 23 2010
    Filed under: Filed under: , , , ,
  • Adding custom interfaces to your mock instance.

    Previously, i made a post  showing how you can leverage the dependent interfaces that is implemented by JustMock during the creation of mock instance. It could be a informative post that let you understand how JustMock behaves internally for classes or interfaces implement other interfaces into...
    Posted to Mehfuz's Log by on Wed, Jun 9 2010
    Filed under: Filed under: , , ,
  • Mocking successive calls of similar type via sequential mocking

    In this post , i show how you can benefit from  sequential mocking feature[In JustMock] for setting up expectations with successive calls of same type.  To start let’s first consider the following dummy database and entity class. public class Person { public virtual string Name { get ; set...
    Posted to Mehfuz's Log by on Mon, May 31 2010
    Filed under: Filed under: , ,
  • 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,    ...
    Posted to Mehfuz's Log by on Thu, Apr 29 2010
    Filed under: Filed under: , , ,
  • 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...
    Posted to Mehfuz's Log by on Mon, Apr 26 2010
    Filed under: Filed under: , , ,
  • JustMock is here !!

    As announced earlier by Hristo Kosev at Telerik blogs , we have started giving out JustMock builds from today. This is the first of early builds before the official Q2 release and we are pretty excited to get your feedbacks. Its pretty early to say anything on it. It actually depends on your feedback...
    Posted to Mehfuz's Log by on Mon, Apr 12 2010
    Filed under: Filed under: , , ,
Page 1 of 1 (11 items)