in

ASP.NET Weblogs

Extreme JS

JS Greenwood's WebLog on architecture, .NET, processes, and life...

New, slicker GUI for NUnit

I use NUnit.  A lot.  Almost every time I hit compile, in fact.  And I'm not a big fan of the command line version; there's a certain feel-good factor from seeing all of the orbs turn green.  But this is where my problem lies with NUnit - although it's technically great, the interface just looks really clunky.  Half of the problem is that it doesn't support Windows Themes - the controls neither have their FlatStyle set to System nor has the call to EnableVisualStyles been made.  The rest of the problem is just to do with small tweaks around changing text to images, replacing the red/amber/green orbs with prettier ones, and so on.

So, as I've got an idea for another NUnit related project anyway, I decided to get to grips with the source code for it by refreshing the UI.  Below are before and after pictures, and the updated files for running it yourself are here:
http://www.altervisitor.com/software/NUnit_GUI_Update_Release001.zip

As I've not changed any real code, only the UI of the EXE (and a UI DLL), this archive simply contains two files to overwrite those that already exist in your NUnit folder.  All your current existing projects, links, etc. should continue to work.  Note that this is an update to the latest version at the time of writing - v2.2 (v2.2.0) , and will only work with this version.

If you like/don't like this update, please get in touch, as I'll be mailing the NUnit guys themselves over the next couple of days to see if we can't get the proper project updated.

Within the next couple of days I should have finished the NUnit-based tool I'm writing, too, which should be well worth the download...


Original NUnit 2.2 GUI


Updated NUnit 2.2 GUI

Published Aug 16 2004, 12:44 AM by jsgreenwood
Filed under:

Comments

 

Matt Hawley said:

I've been wondering myself why they haven't done this. Looks good, but does the red gradient turn green if all succeed?
August 15, 2004 8:36 PM
 

JS Greenwood said:

> Does the red gradient turn green if all succeed?
It sure does. :)
August 16, 2004 3:24 AM
 

OmegaSupreme said:

nice
August 16, 2004 4:25 AM
 

Frans Bouma said:

What I wondered is: why haven't you addressed (or maybe you have, in that case, ignore this message) the no.1 flaw in nunit's gui: the non-wrapped text in teh results window. When an exception occurs, it's one big line, the exception info isn't shown very well, you have to scroll a lot and the line is also chopped off sometimes. Not that great. If you could fix that in your gui, you have a winner :)
August 16, 2004 4:39 AM
 

JS Greenwood said:

I've not addressed that yet (and it is a real pain, you're right). Changing the WordWrap property on a TextBox would be really easy, but that's not what's needed - it's the top textbox that needs the " : " replacing with a linebreak and some indentation. But I didn't want to touch the application logic for now - I figured that the more I diverge from the original codebase, the less chance there is of integrating this all into the "official product". I have made the font a bit smaller though, so you can fit more in. :)

I'll take another look at that and see how easily I can add such a change in (and take it out again). But the project I'm just finishing up at the moment will alleviate this problem in some circumstances, anyway. Just give me a day or two...
August 16, 2004 5:10 AM
 

Roland Weigelt said:

Very nice!
August 16, 2004 7:22 AM
 

Dan said:

It's really nice. IMHO, you should keep the progress red when it fails, this was the main user cue on wether the tests failed or not.
August 16, 2004 9:59 AM
 

JS Greenwood said:

> IMHO, you should keep the progress red when it fails

I see what you're saying, and kind of agree... the problem is that their progress bar isn't a standard Windows one, and it just looks out of place when the rest is all Themed (the Themed Windows one can't change colour). Having the background change to red in the same place on the screen is a fairly obvious cue, though...
August 16, 2004 10:08 AM
 

JS Greenwood said:

> no.1 flaw in nunit's gui: the non-wrapped text in teh results window
Right, I've overwritten the downloadable archive with a new one that solves this:

1. The white ListBox now displays the class name rather than full path to it first, making the message appear much sooner (the full class path is suffixed in brackets).
2. The textbox beneath it has text-wrapping enabled now.
August 16, 2004 2:40 PM
 

Frans Bouma said:

Excellent, I'll give it a testdrive right away!
August 16, 2004 2:52 PM
 

Frans Bouma said:

Great! I first thought.. hmm nothing's fixed, but then I saw you actually show the info that matters first! :) Excellent work! :)
August 16, 2004 2:58 PM
 

Frans Bouma said:

The gradient bar has some bugs. It crashed out of the blue:

************** Exception Text **************
System.ArgumentException: Rectangle '{X=0,Y=0,Width=0,Height=80}' cannot have a width or height equal to zero.
at System.Drawing.Drawing2D.LinearGradientBrush..ctor(Rectangle rect, Color color1, Color color2, LinearGradientMode linearGradientMode)
at NUnit.Gui.NUnitForm.groupBox1_Paint(Object sender, PaintEventArgs e)
at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPrintClient(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
August 17, 2004 7:31 AM
 

JS Greenwood said:

Interesting... That's a bit naughty of Microsoft calling into an OnPaint passing in a zero width. I've come up with a couple of extra tweaks I wanted to add, anyway, so it'll be updated as soon as I get back from the office tonight. Give me 6 hours...

And my other NUnit "project" ran successfully for the first time last night - that should be finished soon too. :)
August 17, 2004 7:38 AM
 

Frans Bouma said:

The crash occurs when I recompile an assembly that's used in hte test (I keep hte gui open). Not always, but sometimes.
August 17, 2004 7:39 AM
 

TrackBack said:

August 17, 2004 7:56 AM
 

TrackBack said:

August 17, 2004 8:21 AM
 

JS Greenwood said:

Update is now available for download (same URL - can't be bothered version controlling it just yet!)

I'm beggared if I know how MS can call into that OnPaint passing a 0 width as part of the DisplayRectangle of a control that's blatantly got width. If anyone reading's on the WinForms team, it'd be nice to know. Anyway, it checks for the width & height, and is wrapped in a try..catch, anyway.

Plus I've updated the tree-view icons, to be in-line with my "mystery" up-coming project...
August 17, 2004 4:33 PM
 

TrackBack said:

November 8, 2004 4:01 PM
 

TrackBack said:

November 29, 2004 6:58 PM
 

TrackBack said:

November 29, 2004 6:58 PM

Leave a Comment

(required)  
(optional)
(required)  
Add