Mehfuz's WebLog

Live crazy, think different!

Sponsors

Browse by Tags

All Tags » Agile (RSS)
Fake a member without passing the instance via 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...
Posted: Jul 21 2011, 05:36 PM by mehfuzh | with 3 comment(s)
Filed under: , ,
Mocking constructor
While unit testing a target type, it is likely that the test is failing during object creation because we forgot to include a mandatory configuration file or a line in the constructor is throwing exception because it is making call to some external service...
Posted: Mar 22 2011, 09:35 PM by mehfuzh | with 1 comment(s)
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 (clean code developer from Germany forwarded to me by Jan from Telerik Germany...
Posted: Oct 06 2010, 05:01 PM by mehfuzh | with no comments
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...
Hands on mocking of ASPNETMVC controller action
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.The target of this...
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...
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...
Posted: May 31 2010, 09:35 PM by mehfuzh | with no comments
Filed under: , , ,
Is your test method self-validating ?
Writing state of art unit tests that can validate your every part of the framework is challenging and interesting at the same time, its like becoming a samurai. One of the key concept in this is to keep our test synced all the time as underlying code...
Mocking property sets
In this post, i will be showing how you can mock property sets with your expected values or even action using JustMock. To begin, we have a sample interface: public interface IFoo { int Value { get ; set ; } } Now,  we can create a mock that will...
Posted: May 14 2010, 07:42 PM by mehfuzh | with no comments
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...
Posted: Apr 29 2010, 11:23 PM by mehfuzh | with 2 comment(s)
Filed under: , , ,
More Posts Next page »