ASP.NET News from Blogger: Mehfuzs WebLog   Get the feed of: Mehfuzs WebLog

Total News: 70

Writing ASP.NET MVC bootstrapper with AutoBox

This will post will show how you can use AutoBox to easily write a bootstrapper for ASP.NET MVC. I have used the latest version of AutoBox (available from nuget, this version also includes Castle.Wind...

Assert the order of expected calls over instances

How you assert through unit test that an user is authenticated before doing withdraw operation? You can surely verify a method is invoked as expected but if you want to ensure the order right then you...

Asserting a mock with test framework

When asserting an expected call for its number of occurrences or may be just to verify if the setup/arrange is acted as intended, the tool generally raises assertion that points us to the reason why t...

Future mocking with #IgnoreInstance

In my previous post, i showed how JustMock picks mock expectations based on current context without the instance being injected. Based on feedback we found that Its sometimes confusing and often does ...

Introducing AutoBox - On the fly dependency injection and caching container.

Just when we have dependencies for a controller, we need to wrap around our heads to write a bootstrapper that will dynamically inject dependencies for a controller in runtime and once we we want to d...

Future mocking revisited

Previously , I have posted how it is possible to mock a method without passing the dependency through a constructor / calling method. This is something true for third party controls and tools where we...

PostSharp and JustMock side by side.

In this post I will show mocking a member call inside a postsharp aspect. There were previously compatibility issues between both of the tools running side by side which is now been officially fixed w...

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 dont want to pass the instance as an argument. Ideally, this is not a best design but there are third- p...

Running JustMock profiler outside of Visual Studio

In this post , I would be focusing on the issue that generally comes to query on how to run JustMock with standalone tools like nunit or msbuild console. Since mocking concrete method works initializi...

Mocking MsCorlib members

In this post , I will show how you can mock  members from MsCorlib. This is more of an introductory post and shows what you need to do in order to successfully mock an MsCorlib member. If you ar...

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

NuGet JustMock

As most of us already know JustMock got  a free edition. The free edition is not a stripped down of the features of the full edition but I would rather say its a strip down of the type you can mo...

Writing LINQ providers easily and elegantly (LinqExtender 3.0)

When writing a custom LINQ provider, developer must focus into plenty of issues other than the main purpose of just creating a LINQ to something. Like how to deal with projection, how to parse va...

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

Mocking SPContext.Current with JustMock

Today, I happen to find an interesting post on mocking SharePoint context using TypeMock. Being a JustMocker, i thought rather to follow the footsteps and see if can do the same with JustMock. I am no...

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 dont know what F# is all about, Its a product from Microsoft research an...

Mocking LINQ to SQL [Continued] using RLINQ

After making the post on mocking LINQ to SQL, this morning i was having a chat with Stephen forte and come to know that telerik a has product named RLINQ. RLINQ is built on top of OpenAccess and it su...

Unit testing LINQ to SQL

Unit testing LINQ to SQL repositories can be very challenging. Unit testing such requires faking hard to mock classes and requires simulation to return your custom data for a particular LINQ statement...

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

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 lets first consider the foll...

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

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

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. I have used another trad...

Doing your first mock with JustMock

In this post, i will start with a  more traditional mocking example that  includes a fund transfer scenario between two different currency account using JustMock.Our target interface that we...

Speaking at the Great Indian Developer Summit

Ill be speaking at the Great Indian Developer Summit from April 20 23  at the Indian Institute of Science in Bangalore (Bangaluru), India. This will be my first ever to the GIDS and hopefully it...

Creating a basic proxy for intercepting [quick update].

In my previous post, i enhanced the proxy to support generic calls. In order to minimize IL emit and move more parts to managed code, there is a better way to process the return value rather doing the...

A basic proxy for intercepting method calls (Part 3)

In my previous posts, I showed how to create a proxy that can delegate calls. I further modified it to support argument list from original method and handled scenarios for void and non-void calls. In ...

A basic proxy for intercepting method calls (Part 1)

In this post i am going to show how you can write your own proxy for delegating calls. This just shows a way how you can handle it on your own but for complex interceptions its always wise to use alph...

Do you Encode your interface ?

Yesterday , i was reading Clean Code by Uncle Bob. While i was doing so , i came across a line that really stuck my thought patterns and i would like to share it with my readers as well. The line loo...

Configuring Team build using XUnit [From client] Update.

In my previous post , i mentioned about configuring Team build along with XUnit without installing anything on the build machine. This is sometimes useful as the build machine is miles away and is sha...

Configuring Team build using XUnit [From Client]

Recently, while i was setting up TFS build [to enable CI] for a project at Telerik that i am currently working on, i came across configuring it up with XUnit for doing automated tests every time someo...

Introducing LINQ to M

Now , it happens that you go to McDonalds website order an item for you. It could happen that price of the menu changed or new one comes to the menu. Now, generally it can happen that admin can go tho...

Operation could destabilize the runtime Reflection.Emit and common pitfalls

In the last post i said about LinqtExtender implementing necessary property and injecting specific settings for entity objects. The issue i have is that it works fine under full / high trust settings ...

Extending your existing API or legacy data classes to support LINQ

While developing LinqExtender, i have come across various scenarios that people dont want to extent any query class or even implement any interface. Also, it is almost absurd when they have to add new...

Using of JSON Result in Asp.net MVC 1.0

In a post few month back , i showed how can i simulate a callback using JQuery and ASP.NET with my experimental FlickrXplorer project. More detail on this can be found at the following URL http://web...

Programmatically generating SQL(DDL) from M

In this post, i will show how you can generate SQL programmatically from M. Now, so far i have learnt that MGrammer is a contract that converts users input into MGraph. Now, Oslo by default comes with...

Create custom LINQ providers fluently

Just released LinqExtender 2.0. Over previous release , it contains generally bugs fixes. Overall, I have focused on striping out complexity as much as possible to keep you focused on your business lo...

Adding streaming video content to your site

In my last post, I showed how to turn on Amazon S3 support in Sitefinity. In this post, I will show how to create a simple video site using the video library support that is bundled with 3.6 release. ...

Amazon S3 support in Sitefinity 3.6

Here at Telerik, Sitefinity team is preparing for the 3.6 release next week. 3.6 comes with lot of core level enhancements and cool new features. Of which , I can't but mention one feature that will m...

Creating LINQToTwitter library using LinqExtender

In this post, I will show how to cook an LINQToTwitter library with LinqExtender. My target is to create it easily and over existing twitter API. I used Yedda Twitter library. Yedda library basically ...

Making cross domain web requests in asp.net with medium trust enabled

There could be plenty of reasons that you might need to do a cross domain web request in your application. One could be let's say you want to divert the resource pressure from your server to some thir...

Retrospective of PDC 2008 [From my view]

This happens to be the first PDC for me. This year a lot of new technologies has been unveiled during the keynotes. One of the most focused is the Windows Azure. This happens to be the one stop shop f...

I am here at PDC 2008

  Finally, PDC 2008 is going to roll on this Monday, when the Ray Ozzie will start the day with his keynote. This year there will be quite a new things to be announced during...

LinqExtender 1.4.2 - Supporting Complex type arguments

I just made a quick update to the existing release of LinqExtender. I recently found a bug while building a feature for FlickrXplorer is that if you use constant type query with orderby clause it does...

Using jQuery to do Ajax Form posts in Asp.net MVC

It is now official with Scott Guthrie's post that jQuery will be bundled with Asp.net. jQuery is a tiny 15K JavaScript library that contains features from UI tweaks, DOM manipulation to full Ajax cont...

Asp.net MVC more Form post scenarios and Ajax

In the flickr explorer app made with Asp.net MVC and Athena, I was trying out some form post scenarios. In this post, I will add few things regarding MVC form post and Ajax that is common to FlickrXpl...

Deploy, test and pack your code - Part 2 Using MsBuild

In part one of this packing series I have shown, how you can automate your build process, test and optionally mock by using the popular .net deployment tool NAnt. If you don't know what I am talking a...

Deploy, test and pack your code - Part 1 Using NAnt

In this part, I show a way to build and deploy your project using NAnt. As, you already might know that NAnt is a tiny deployment tool that enables you to create a deployment package with some  *...

Bundle SQL script with build process using MSBuild

We are making a sample application, demo or startup kit or a toolkit with test project that requires some SQL scripts. We generally ship in a readme.txt that says it all. But hey, how about having the...

LinqExtender 1.4 - Enhanced object tracking

Its been quite a while since I made any release of the toolkit. I basically, get into user requests, used it myself in LinqToFlickr project and came up with some new features and enhancements. In my ...

View Other bloggers