• Testing for Exceptions with NUnit

    I’ve been aware for a long time usual way of writing a unit test with NUnit that expects an Exception to be thrown is to use the ExpectedExceptionAttribute on the test method.

    [ExpectedException(typeof(ArgumentException)] [Test] public void Test() { var sut = new ThrowUp();

    sut.DodgyMethod(3); }
    

    I hadn’t noticed that around the release of NUnit 2.5, an alternative was added. The Assert.Throws method allows you to be specific about which bit of code in the test should be throwing an exception.

    public void Test() { var sut = new ThrowUp();

    Assert.Throws<ArgumentException>( () => sut.DodgyMethod(3) ); }
    

    I think it’s a good improvement, and makes it a bit clearer where the exception should be coming from.

  • ADNUG November–Azure for Developers

    With the recent announcement that Azure now has two data centres located in Australia, I thought it was appropriate for the Adelaide .NET User Group (ADNUG) to spend some time looking at what’s involved in hosting your applications in the ‘cloud’.

    The session will review what features Azure offers, and then we’ll step through hosting a simple web application and then scaling it up and out.

    Register at http://www.acs.org.au/branches/south-australia/events/upcoming-events/event-details?eveID=10310633303016

    Wednesday 12th November 2014 at 6.00 pm at Marcellina Adelaide (273 Hindley Street, Adelaide)

    6.00 Pizzas and Networking 6.20 What’s New (Ryan Spears) 6.40 A Developer’s guide to Microsoft Azure (David Gardiner)

    Look forward to seeing you there!

  • In the garden–Spring 2014

    Not a lot of veggies planted at the moment. It has been an unusually warm spring so far. This week we had one day that got up to at least 36°C. That’s more common for January than October.

    Globe artichoke A globe artichoke that Narelle planted last year has shot up again.

    Lemonade fruit The lemonade tree has been been very productive again. There’s still a few fruit left. We’ve made quite a lot of juice this year.

    Cabbages These cabbages are growing well, though the cabbage moths (well actually their caterpillars) are doing their best to get in first.

    Tiny lime fruit We planted a lime tree a couple of years ago. It doesn’t like our cold winters, but now the weather has warmed up it has put on a fresh lot of leaves. I’m hoping this tiny fruit will stay on the tree and grow to full size!

    The roses are having their first bloom after winter. They are looking very colourful.

    Roses in bloomPink standard rosePing roseIceberge rosesPink rosesYellow rosesDSC_4040

    Lavender flower with beeBearded iris flower Lots of lavender and bearded iris are also flowering. The bees really like the lavender.

    Plenty of weeding to do at this time of year too – but I’m not going to take photos of those!