MbUnit and null parameters

I’ve recently moved from NUnit to MbUnit.  I like the extra features it offers, in particular, the RowTest feature.  This allows a single test to take different parameters – the parameters of which are specified in the attributes.  Here’s an example:

 

 

Here, Test1 is being given the parameters from the attributes on the test.  Previously, say, in NUnit, I’d have written a couple of unit tests that create this Test object and give it different values.  Normally, I’d also write a couple that would try and create one with a null string and an empty string and assert that it throws an ArgumentNullException.

Now, in MbUnit, I went to write the test like so:

Strangely, this caused an internal error in MbUnit.  Reading around, It looks like MbUnit is taking the first parameter of Row and treating it as an array rather than a single parameter.  The complete non-obvious way around this is to cast the null to a string:

 

This now works.  Which is nice!

Please follow and like us:

ReSharper 2.0.1 Maintenance Release Now Available

 

ReSharper 2.0.1 Maintenance Release Now Available

JetBrains ReSharper version 2.0.1 is now available for download at http://www.jetbrains.com/resharper/download/.
This release fixes a number of bugs and usability issues, in addition to substantial performance improvements. For more information, please see online Release Notes.
The update is a free maintenance release for all licensed users of previous ReSharper versions. All current users are highly encouraged to upgrade, due to the transition of the ReSharper development project to a new issue tracking system. So, the new release automatically sends bugs and exceptions to this new system.
Keep developing with pleasure!

Source: JetBrains .NET Tools Blog » Blog Archive » ReSharper 2.0.1 Maintenance Release Now Available

Please follow and like us:

Windows Live Writer – Additions to API

Maybe this already exists, but it’s not immediately obviose.  When developing a plugin, the component that sits along the right side of the screen is the Content Editor.  WLW has its own color scheme and to intermingle* nicely with it, it’d be nice if the color(s) used were available.

*is that a word?!

Please follow and like us:

Code Formatter Plugin for Windows Live Writer

I’m quite new to blogging and have recently discovered Windows Live Writer. I’ve downloaded various plugins for code formatting but none provided me with what I wanted:

  • The ability to format the code ‘live’
  • The ability to wrap lines
  • The ability to change the background color
  • The ability to just quickly paste what’s in the clipboard as code

The plugin I implemented formats and highlights code and also does all the above. Here’s a screen shot of it in use:

Here you can see that the content editor on the right can change the tab width, background color, language, and line numbers.

Below are some sample of code used with the plugin.

Here’s some C# code:

and some XML markup…

I’ve made available the source and the binaries for this plugin.

To use it, extract the binaries to Windows Live WriterPlugins and run WLW. The source is in C# 2.0 and comes with a Visual Studio 2005 solution.

Note that the .NET 2.0 Framework must be installed before this plugin will work.

Going forward

I plan to put this plugin onto CodePlex (if they let me!). I also plan on making a few additions to the defaults via the Options screen. New languages can easily be added too thanks to the great ActiPro Code Highlighter. I’d also like to thank Christophe De Baene for his syntax highlighting tool. It’s a great plugin and also helped me understand how to use the ActiPro control.

Please let me know if you’d like to contribute on CodePlex or if there are any features you’d like to see at steve at dunnhq d.o.t. com

Please follow and like us: