Need Unit Testing Academy then join TypeMock Academy

by mosessaur| 21 April 2010| 0 Comments

TypeMock is holding its first TypeMock Academy on 27th April 2010 on Oslo, Norway. So are you interested in unit testing?! If you are, and you are software developer or consultant join them on this very first academy.

You can expect to see the following TypeMock experts while being there:

Along with very special appearance and very special guest Uncle Bob Martin

You can find more details on the Typemock site.

During the Academy Typemock will also release their new Test Lint VS 2010 RTM. You can try out the beta of Test Lint for free now: http://site.typemock.com/test-lint/

Facebook RSVP.

KiGG Design And Architecture – Part 4 Inside Infrastructure

by mosessaur| 30 January 2010| 3 Comments

Introduction

This is part 4 of this series which I don’t know when it will ends :o). In part 3 I started to to explore the Core of KiGG. In this part we are still inside the core, but we are going further deep to have a look inside the infrastructure.

I’m going to talk about infrastructure for the next couple of posts or maybe more. Because actually it contains the heart of KiGG. For me this is a really interesting topic, it is kind of like a hobby but whereas other people like swimming or playing Poker Online, I like investigating infrastructures. I hope that you find what I write interesting and informative.

More...

KiGG Design And Architecture – Part 3 The Core

by mosessaur| 29 December 2009| 4 Comments

Introduction

In part 2, we explored KiGG project structure. I gave a short brief and summary about each project in the solution. And briefly discussed the relation between them.

In this part we are going to start going much deeper. Staring with the Core, and this might take several parts by itself as the Core is huge and contains lots of stuff that worth to be discussed.

More...

Entity Framework Podcast and Unit Testing Video

by mosessaur| 22 December 2009| 0 Comments

Just done with my first video about Unit Testing Entity Framework with TypeMock Isolator. It is my very first video actually made in the community.

Also last October, I was interviewed by DotNetArabi on Entity Framework. That was my first Podcast too. The Podcast was in Arabic.

Here are links for both:

Hope you’ll enjoy it.

KiGG Design And Architecture – Part 2 Project Structure

by mosessaur| 27 November 2009| 2 Comments

Introduction

In part 1 I talked about KiGG high level architecture. In this part I am going to talk about KiGG project structure and summarize the purpose of each project in the solution. I’ll not go into deep details of each project. I’ll save that for some other posts, just be patient with me and stay tuned.

More...

KiGG Design And Architecture – Part 1 The high level design

by mosessaur| 15 November 2009| 4 Comments

Introduction

In this multi part series I am going to explore KiGG design and architecture as well as projects structures.

At the beginning I would like to give a brief about KiGG History.

About KiGG

KiGG is similar to DotNetKicks, Digg and DZone. However it much closed to DotNetKicks and way smaller than DZone. KiGG was founded by Kazi Manzur Rashid and first introduced in his article on DotNetSlackers.com: Kigg - Building a Digg Clone with ASP.NET MVC, that was on Feb 2008. It was built with First ASP.NET MVC preview.

In early this year 2009 on January, Rashid was almost done with KiGG, however ASP.NET MVC 1.0 was not released yet. At this time Rashid announced DotNetShoutout.com as first live application based on KiGG. On March 2009 Rashid released version 2.2 of KiGG after the release of ASP.NET MVC 1.0.

I joined the team on April and start working with Entity Framework implementation for KiGG as well as supporting the project.

Thank you Rashid for giving me this opportunity.

More...

Introducing Entity Framework Unit Testing with TypeMock Isolator

by mosessaur| 06 September 2009| 7 Comments

Introduction

One of the challenging things with current version of Entity Framework, its leakage of testability. Which means when you build an application or module (e.g. Repositories) that depends on entity framework, it will be very hard to unit test your code isolated from Entity Framework. This might lead to conduct Integration Testing which will require a connection and interaction with underlying data store (database).

You might think of using to mock or fake Entity Framework data store dependent calls. But sadly and Rhino Mock mocking frameworks do not support this. And you’ll end up hitting the wall. Both frameworks are great useful and I personally use for a while now and very happy with it. But no one can deny limitations when exist.

And personally I was able to overcome the limitation of the testability of Entity Framework while I was working in  Entity Framework based models and repositories. But done that through unnecessary code refactoring and wrappers around none mockable classes such as sealed class EntityCollection<T>.

Finding a solution with TypeMock Isolator

In fact there is a solution, that will save you lots of workarounds and unnecessary code refactoring. You just need a full isolation framework. Isolator provides this capability. It allows to mock sealed classes and classes that have private constructors, static methods, and much more.

makes it easy to simulate and break the dependencies of any object in your existing code. In that way, it doesn’t force you to think about how your design might need to change. –The Art of Unit Testing book page 132-

So, TypeMock isolator is a perfect mate for testing code that has dependencies on Entity Framework as how I am going to show now.

More...

Domain Driven Design & Test Driven Development\Design using Entity Framework, Part 2.A Unit Testing Entities With Moq 3

by mosessaur| 24 March 2009| 3 Comments

I had about DDD & TDD with Entity Framework that you might need to return to them before you proceed with this post. To summarize these posts, I was trying to build testable Models that is based on EF. But EF doesn't support Persistence Ignorance in its first version which make testing it in most cases require a database connection where you can test you code against it. My target was to build a testable models based on EF and that is independent of any underlying data source.

Introduction, Domain Model Review:

EntityModel-DDD

More...

Domain Driven Design & Test Driven Design\Development with Entity Framework Part 1.b Integration Testing for ObjectContext

by mosessaur| 23 February 2009| 0 Comments

I decided to provide some integration testing before proceeding as a proof of concept. In integration testing I will connect to the database and perform unit testing while connecting to the database.\

This unit test is almost identical to the one in my previous post. Except here I am testing the results that is coming out from EF and Database.

My target is to test IDataContext Implemented methods in NorthwindDataContext. Find below the Integration unit testing class. More...

Domain Driven Design & Test Driven Development\Design with Entity Framework Part 1.b, Review

by mosessaur| 21 February 2009| 3 Comments

In return to my previous posts about DDD & TDD with EF. I discovered few catches in my design that I wished to high light and discuss in this post. To summarize my take here are the head lines:

  • What is the Responsibility of ObjectContext in EF?
  • What is the Responsibilities of Repositories and whether they should be coupled with EF or not?

I come up with this post after few discussions through e-mail with Davy Landman.

More...