Friday, 29 March 2013

NServiceBus Testing with Unobtrusive messages

I’ve just had a problem when using nServiceBus.Testing.

When I was running my unit test i was getting
image

Turns out this service was using unobtrusive messages and it appears that nServiceBus.Testing isn’t aware of that and there doesn’t seem to be a way to make it aware.  Currently I’ve just added IMessage to my messages.

NServiceBus config errors

If you get an error about logging when starting a nservice bus service drill down on the exception to see what the real error is.

Tuesday, 25 September 2012

Get the value of an adjacent cell with jQuery

   1:   var row = $(this).closest('tr');
   2:   var description = row.find('td:eq(1)').text();
   3:   var code = row.find('td:eq(0)').text();

Thursday, 16 August 2012

Using IMappingEngine with Castle Windsor

I must remember this

container.Register(Component.For<IMappingEngine>().UsingFactoryMethod(()=> Mapper.Engine));


From http://stackoverflow.com/questions/1719725/inject-automapper

Saturday, 14 July 2012

Stop EF looking for migration tables

I keep forgetting how to do this should I’ll post it here.

Database.SetInitializer<DataContext>(null);

Thursday, 1 March 2012

Localisation of built in MVC validation messages

While working on web site for a client in Belgium I was wondering why the Required attribute error message wasn’t being localised based on the CurrentUICulture of the thread.

This was bugging me, so I downloaded the MVC 3 source code from CodePlex and found the Required attribute unit test.  Even after changing the thread to use Flemish the below test still passed.

image 

After talking to Damian we found that there are Language Packs for .NET 4.  These can be obtained from http://www.microsoft.com/download/en/details.aspx?id=3324

These packs will install the required resources in you .Net 4 framework directory.
image

As soon as I installed the Dutch language pack the above test failed as expected.

image

I still need to test what gets stored in the logs when these packs are installed and an exception is thrown.  It won’t help us much if errors in the logs start getting stored in the language of the user that is logged in.