.Net Technical

Random NUnit Tip

Wednesday, June 2nd, 2004 | .Net Technical | Comments Off

Often when writing NUnit tests I find myself wanting to output some stuff to the Console in order to make sense of a failing test. But, you don’t want the console window filling up with rubbish when the test is passing, so instead of doing this…

[Test]
public void DoesSomething()
{
string expected = “some expected result”;
object someObject = new SomeObject();
string actual = someObject.DoesSomething();
Console.WriteLine(expected);
Console.WriteLine(”—-”);
Console.WriteLine(actual);
AssertEquals(”SomeObject should do something”, expected, actual);
}

you can do this…

[Test]
public void DoesSomething()
{
string expected = “some expected result”;
object someObject = new SomeObject();
string actual = someObject.DoesSomething();
try
{
AssertEquals(”SomeObject should do something”, expected, actual);
}
catch(AssertionException)
{
Console.WriteLine(expected);
Console.WriteLine(”—-”);
Console.WriteLine(actual);
throw;
}
}

Then the Console output only shows up when the test fails. Nice.

Excel…lent

Sunday, April 18th, 2004 | .Net Technical | Comments Off

Generating an Excel file from .Net should be easy right? MS have good reason to have you using their formats as the de-facto standard and make it easy, huh.

Nope. Not really.

It’s a bit trickier than you might think.

› Continue reading

Jet Brains ReSharper

Wednesday, February 25th, 2004 | .Net Technical | Comments Off

Another C# refactoring tool crossed my browser windows today…

JetBrains ReSharper The Jetbrains C# plugin for Visual Studio EAP program is open: http://www.jetbrains.net/resharper The username and password are both ‘eapuser’.

I haven’t tried it yet.

Building a simple CMS XML Placeholder

Thursday, February 12th, 2004 | .Net Technical | Comments Off

I’ve just been down to see some guys in the middle of nowhere… Beautiful little office on a deer park, with views over fields and so incredibly quiet. A company called Torchbox who are getting up-to-speed with MS CMS.

While I was there the big question was why one of their placeholders wasn’t working, which I think we figured, but I also put together a very basic XML Placeholder control to act as a base for them. I thought it would be worth dropping it up here for the record.

› Continue reading

XP Toolset for .Net

Monday, August 25th, 2003 | .Net Technical | Comments Off

We’ve started doing TDD and Continuous Integration a bit more formally and have brought together a toolset to support this on the .Net platform. For reference this is currently:

Visual Studio.Net - IDE
Visual SourceSafe - Configuration Management
nUnit - Unit Test Framework
CruiseControl.Net - Continuous Integration Process
nAnt - .Net Build Tool
FXCop - Coding Standards validator
DevPartner Profiler - Performance Analysis and Test Coverage

Morgan’s Images

Sunday, May 25th, 2003 | .Net Technical | Comments Off

Morgan Skinner’s written up some nice stuff on color quantization, mapping using both a palette based approach and an octree based algorithm which is also very nice.

This follows on from work I did with him back in 2002, and adds to it.

Dynamic Image Generation

Wednesday, May 22nd, 2002 | .Net Technical | Comments Off

The .Net Framework has, like many frameworks and class libraries before it, some natty little features for drawing images and for saving or streaming them in different formats.

As part of getting to grips with C# I decided to put together some image generation routines for web based buttons, but discovered that it was not all as simple as it should be.

› Continue reading

.Net Reflector

Wednesday, March 6th, 2002 | .Net Technical | Comments Off

Morgan Skinner put me onto a very nice little toy today called .Net Reflector.

Basically, it uses reflection to scan through assemblies and list the namespaces, classes, methods and properties therein. Incredibly useful for scanning through the framework classes and finding the bits you need.

http://aisto.com/roeder/

Search

Right Now (ish)

Meta