Following on from my last post in the MbUnit 101 series I’ll cover MbUnit’s attributes. MbUnit has the basic Test attribute.

The additional meta allows for filtering and ordering in a test runner (for example Echo or Icarus).  We can also control how MbUnit treats what it tests.

MbUnit also has exception control in the attribute model. Taking the following class.

We can do the following.

Note that MbUnit also offers exception support in the Assert model as noted in the Assert.Throws.  Finally MbUnit has support for threaded runs over tests.

These examples and more can be found on github.

First in a series on MbUnit features and I’ll start with Asserts.

MbUnit supports the style of Asserts that you find in NUnit and others as well other styles. For example Assert.That supports NHamcrest syntax, for example.

You can also chain HHamcrest expressions.

MbUnit also supports Linq expressions in AssertEx.That, for example.

The Gallio team has been hard at work on creating a plugin for the VS2011 test window and I am pleased to announce we have an initial release up on Github. The plugin has been developed to work with the most recent public release of VS2011, as and when Microsoft release new versions of the IDE we will update the plugin.

Please note that as of writing we have a known bug with multiple assemblies.  The plugin will ignore NUnit and XUnit tests by default (even if they enabled in the Gallio control panel).

I am taking MbUnit back to the ThoughtWorks Manchester geek night on the 14th September. The last time I presented MbUnit at this night was over two years ago so I have a lot to go over.  I am looking forward to taking MbUnit out for a spin with the folks at the night.

The latest release of NCrunch now features support for MbUnit, XUnit and MSTest (adding to the existing support for NUnit and MSpec). Further more the MbUnit and XUnit support is powered by Gallio.

The support for this started with a conversation between me and Remco Mulder (the author of NCrunch) at SC2011 back in May and continued over email as Remco integrated NCrunch and Gallio.   This was a challenging integration and Remco worked hard to overcome many of the challenges, as a result he is also contributing code back to the Gallio code base.

It is great to see NCrunch join the family of third party tools that now support MbUnit.

Today I attended a one day technical conference that ThoughtWorks hosted at their Manchester, UK office. With an attendance of around 70 and two streams the sessions were nice and focused with plenty of questions and discussions (most sessions ended up running over).

The two sessions that stood out the most to me was the Agile Architect session with Erik Doernenburg and Scala at GU with Graham Tackley  I did however learn a lot from all the sessions and it was a lot of fun to talk programming languages (mostly CLisp weirdly) with other attendees.

There is talk of them hosting another and it would be great to see loads of folks from the Manchester area feature. It would also be loads of fun to see Neal Ford and Dan North, maybe even Martin Fowler.

Just one of those things that I change blog location and then take a 5 month break from blogging (I do use twitter a lot though). After the break I do want get my blogging back on track and while I was down at Bletchly Park last week for the Software Craftsmanship 2011 conference I really want to get my thoughts down.

This was my first visit to the home of the code breakers and I really hope that you all get to visit, it is an inspiring place with a rich vein of history in our industry.  An ideal place for a conference on software with a focus on how we as software engineers can be better at what we do.

The sessions were in the large part hands on with pairing up to work on software problems,  this as a learning tool is invaluable and what struck me the most was the depth of attendees. I paired up on several occasions with Java programmers, with me working in C# and between us we forgot the daft language arguments and focused on solving the problems following good software engineering principles (SOLID, DRY re-factoring etc). One tool I was introduced to at the conference was NCrunch and used it across all my sessions, I cannot recommend it enough for TDD and will be a tool to watch.

The last session of the day was titled ‘Medical codes of conduct in Software’ and it stuck in my mind the most in that it talked about how the medical profession has codes of conduct and how that could be applied to software teams. It created a lot of discussion with the attendees and I like the idea of software teams drafting up their own internal codes of conduct both internal to the team and across the business.

When I look back at last years look at 2010 my blogging rate has not changed much (I suspect this is largely down to using Twitter a lot) but my interests this year have developed a lot further.

My view on 2010 would be that Microsoft would commit more to OSS, while I wanted to see more hires from that audience and more projects on Outercurve foundation instead there has been support for JQuery and Gems (aka NuGet). I would love to see more from Microsoft on the OSS front in 2011, Outercurve could become like the Apache foundation with enough support.

Staying on the Microsoft front I predict that 2011 will bring the following.

  • C# 5.0 will go RTM (still no MOP though)
  • The next release of VS will go alpha or early beta
  • MS MVC 4.0 (I think by Mix time) and maybe this release will get a command line.

I also suspect that Microsoft will want to target the tablet market with WP7 in 2011 (Mix 2011 maybe…).

I also predict the following

  • Java will fork with Apache\Google. Oracle will then take them to court and the whole thing will boil right through 2011 (Java have had enough court cases, come on guys). Java and the JVM will sadly not move forward at all in 2011.
  • Android will cause Apple a serious headache, both the smartphone and tablet market will see figures cut from Apple share. By the end of 2011 the current 70% apple market share will be 40-50%. As the features, performance and price of Android devices gets ever better Apple will be left out in the open.

Lastly after 7 years I intend to move this blog away from weblogs. In 2011 I will be exploring Java, Ruby\Rails and Android and such subjects don’t make sense to talk about it here.

See you in 2011.

MbUnit\Gallio 3.2 was released today and includes many new features and fixes.

The release notes can be found here, you can find the download here.

Icarus

Icarus continues to grow as feature rich GUI for running unit tests, this feature has added a search feature as well a number of bug fixes.

Echo

New command line option to allow reports to be compressed as a Zip.

We also offer this support in the MsBuild task, CCNet task and PowerShell integration.

VS Integration

As noted in previous posts Gallio has offered integration with the VS unit test tools for some time now, in this release we have added support for the new VS10 Data Collector feature.

TD.NET

You can now configure TD.NET options from within the Gallio control panel.

MbUnit.

This release has added a number of new features to MbUnit. 

The Mirror framework replaces the reflection support that has existed since v2 and offers a powerful way of testing non public members.

Assert.Count

 

Also see this post from it’s author.

Brand new XML Assertions

  • Assert.Xml.AreEqual
  • Assert.Xml.Exists 
  • Assert.Xml.IsUnique
See the new documention on this feature and this post by it’s author.
 
 
 
New Attributes
 
 
 
 
 
[Disable] attribute to create abstract test fixtures and methods.
 
Fluent syntax for the Data Generation framework.
 
 
 
Also see this series of posts on the MbUnit Data Generation Framework.
Other

This release was made possible with contributions from Jeff Brown, Yann Trevin, Graham Hay, Vadim Kreyin and Andy Stopford. The core team also wishes to thank the help of Euan Garden, Bruce Taimana and Michael Koltachev.

Finally, with this release I am resuming my role as MbUnit’s poobah and help drive Gallio and MbUnit on to the next milestone.

The O in the SOLID principles, Uncle Bob explains this simply

A class and it’s component parts should be Open for extension and Closed for modification.

To follow this principle let’s take the clock object again. We know from SRP what parts are responsible for what and when we mix these we can create new kinds of clocks. Certain things may be internal to a clock part such as the clock face.

The clock face may be composed of several different things such as the display, hands and numbers etc. If the face was to change from say roman dail to micky mouse we don’t want to have one clock face object that we have to keep changing\rewriting for every different kind of face (you risk code duplication) but instead give it (extend it) the component parts it needs. A mickey mouse clock face would have mickey mouse hands, display and numbers but would display the hours\minutes via the rest of the clock object in the same way as the roman dail or any other type of clock face.

In software terms the way we achieve OCP is with either simple inheritance or dependency injection. More on these in later posts.

Twitter

Follow

Get every new post delivered to your Inbox.