UnitTesting with SQLite

by Mikael Henriksson 25. October 2009 00:34

I just had one of those frustrating moments where the unit tests on my machine works but those on the build server does not! This time I was pretty sure what the issue was. Any time that StructureMap tries to build the session factory and this fails I get strange exceptions in places that hasn’t even been hit. This caused me to first ponder why it would not configure NHibernate on the build server and instantly I thought of SQLite. Now don’t get me wrong I love SQLite but the difference between the x64 and the x86 version has caused me a lot of problems.

I ended up checking if the build number property is set in the build script and if so copy the x86 version of System.Data.SQLite.dll and overwrite the x64 one I use by default. I wouldn’t say that is convention over configuration… I’d say it’s a kick in the nuts for convention this time but it’ll have to do.

Tags: , , ,

NAnt | Team City | Testing | NUnit

How to get Resharper intellisense to stop complaining about Namespaces

by Mikael Henriksson 23. October 2009 20:22

A long time ago I participated in one of these old forum discussions about where to put interfaces. Some people argued that their interfaces went in a subfolder called interfaces. This whole discussion was part of a longer inversion of control discussion. Me myself and Irene thinks that the interfaces should go hand in hand with the default implementations. When I end up with too many interfaces I like to tuck them away in a subfolder but that makes Resharper complain about the namespace is out of sync with the location. I won’t under any circumstances move the interface to an interface namespace location because that is just bad practice IMHO. It should be with the default implementation but you can still have it in a different folder.

All you need to do is right click on the interface folder and select properties:

folder

Here is a setting called Namespace Provider:

properties

Now R# will stop complaining. :)

PS. Don’t ever under any circumstances name a class the same thing as the namespace it is located in…. it can cause some seriously slow build times!

DS.

Tags:

Visual Studio

StructureMap – It doesn’t get any easier…

by Mikael Henriksson 4. October 2009 00:31

Thanks for a great product. I was trying out a variety of IoC products and the one that I was instantly able to use in a very intuitive way was StructureMap.

5/5 – Up and running in a few minutes
5/5 – Documentation
5/5 – Concepts

Hey I ain’t even using it’s full potential yet. I only needed somewhere to store something based on which project I am currently using without the whole project reference thing. Works great :)

Keep up the good work guys!

Tags:

IoC