Google Android Development Agency SASS

Wednesday 9 December 2009

NUnit and App.config

Here's the problem: You have a project which you want to unit test with NUnit but the project relies on some appSettings or other config data normally loaded from app.config or web.config. You know the sort of stuff, connection strings, usernames etc.

When you run your code in NUnit you get a NullReferenceException when you try to access your config, it's like it's being ignored.

I come across this problem quite often but I always have to refresh my memory of how I fix it. Well there's two ways, but only one I can get to work reliably:

1) When you create your nunit project, rather than clicking Project-> Add Assembly, just drag your DLL from Windows Explorer onto NUnit. After doing this it'll pick up the assembly.dll.config file for your assembly. I couldn't get to work reliably though, it would work once and then fail.

2) You need to have a config file named the same as your nunit project and located alongside. So in my case I have com.sass.ecommerce.tests.nunit and alongside it my assembly (com.sass.ecommerce.tests.dll) and my renamed config file, com.sass.ecommerce.tests.config.

Doing it the second way gave me more reliable results and I could access my config file no problem from my unit tests.

Tuesday 1 December 2009

Tub Thumper Pro for Android out this week

At long last, we're looking at releasing Tub Thumper Pro for Android this week.

We've been into Android Development since day one and I've been constantly suprised at the amount of positive feedback we've had from the first version of Tub Thumper. We receive emails daily asking us about the pro version so I'm hoping it's going to be well received.

I'll put some more details online once it's live in the Android Market, but here's a screenshot of the sequencer interface in the meantime, which is one of the coolest new bits.


Tub Thumper Pro Sequencer Screenshot
You'll need at least Android 1.5 to run it and a touchscreen device. It's pushing the low-level audio features of Android with this tool, although I already have plans for Tub Thumper Pro 2! Watch this space...

At last! A good UML Editor for Visual Studio

For years I've been trying various different UML/CASE tools for designing .NET based solutions and until now I've always been left diasappointed. (I've not tried the new in-built tools of Visual Studio 2010 yet...)

This week I've been working on an e-commerce system for a client of ours who have chosen to use Sagepay as their payment gateway. Their site is built on the Kentico CMS platform and the Kentico E-commerce system doesn't support Sagepay out of the box, so basically I'm designing a payment provider for it.

I decided to try once again to find something decent to do Use Case diagrams, Activity diagrams, ST diagrams etc in so that I don't have to resort to Visio and Word as always.

Praise Jebus! Something good at last in the form of Tangible T4 Editor for Visual Studio. This is a plugin for VS.NET which allows you to create half-decent looking UML painlessly.

Here's an Activity diagram for the aforementioned e-commerce system I'm working on:




The only gripe I have so far is with the Use-case diagram tool; it would be really nice to be able to double-click on a use-case to open up a text-view of the actual use case allowing me to document the steps and pre and post conditions.

Here's the best bit: THERE'S A FREE VERSION!