December 4, 2008 – 12:00 am
expand listbox items
hi, I have a listbox and have managed to expand it when a user double clicks on an item. but if i have 4 results the results will show at the end of these 4 results e.g. year month day minute
TFS Event Handler v1.3 released
Updated and improved for Team System 2008. http://www.codeplex.com/TFSEventHandler The TFS Event Handler makes it easier to notify users of changes to Work Items in Team Foundation Server. You will no longer need to add individual alerts to users. It is developed in .NET 3.5 SP1 for Team Foundati
Martin Hinshelwood
TestDriven.NET 2.18 + NUnit 2.5 Beta
I ve just uploaded a new version of TestDriven.Net with support for NUnit 2.5 Beta.
There s a menagerie of weird and wonderful new attributes to choose from in this point release of NUnit. Ben Hall has written a good summary of the Alpha version and I m sure Charlie Poole will be blogging about the Beta in the coming days.
Here s a quick summary of a few new attributes:
Generic test fixtures can be used when you need to run a batch of tests against few different implementations of a type. In the past something similar could be achieved by having an abstract base fixture and extending it for each implementation you needed to test. By using a generic fixture you keep all your test code in a single class and I think it s more expressive.
[TestFixture(typeof(ArrayList))]
[TestFixture(typeof(List<int>))]
public class IListTests<TList> where TList : IList, new()
{
[Test]
public void Count()
{
IList list = new TList { 1, 2, 3 };
Assert.AreEqual(3, list.Count);
}
}
The TestCase attribute is similar to MbUnit s RowTest . With this attribute you transform a single test method into multiple test cases. You can also define an expected return result, but I d advise against using this if you want a stack trace when your test fails. It s better to explicitly define the assert inside the test method.
public class TestCases
{
[TestCase(4, 2, 2)]
[TestCase(2, 1, 1)]
[TestCase(5, 2, 3)]
public void Add(int answer, int a, int b)
{
Assert.AreEqual(answer, a + b);
}
}
In previous versions of NUnit you could specify which threading model your tests required by adding some XML to your test project s App.config file. You can now specify this directly on the test that needs it using the RequiresMTA/STA attributes.
[Test, RequiresMTA]
public void MTA()
{
Assert.AreEqual(ApartmentState.MTA,
Thread.CurrentThread.ApartmentState);
}
[Test, RequiresSTA]
public void STA()
{
Assert.AreEqual(ApartmentState.STA,
Thread.CurrentThread.ApartmentState);
}
Lastly the TestFixture attribute is no longer required and test methods are allowed to be static. This means NUnit can now be used in a natural way for testing F# code. Note, you will need to have "Other Flags" set to "–optimize+ notailcalls" in your project s build properties if you want to see a stack trace on any failed asserts.
#light
open NUnit.Framework
[<Test>]
let fsharp() =
Assert.AreEqual(2 + 2, 4)
Update: I ve tried to highlight a few features in NUnit 2.5 which can be used to make your unit tests clearer. Xerxes Battiwalla has written a post about Assert.Throws<T>() which also falls into this category.
[Test]
public void CreateDomain_Null()
{
Assert.Throws<ArgumentNullException>(() => AppDomain.CreateDomain(null));
}
For more information see the TestDriven.Net 2.18 release notes and the NUnit 2.5 documentation.


More Network Protocol Training
As I noted in two recent blog articles (here and here), Network Protocol Specialists are running a series of WireShark Quick Start webcasts. The second session is to be held tomorrow, December 3 at 10:-00 PDT (Or 18:00 in the UK and 19:00 CET). This second web cast covers Using Display Filters and L
Thomas Lee
Improved support for MbUnit, xUnit and Gallio
The main focus of the TestDriven.Net 2.18 release has been to improve support for test runner plug-ins in general (not just NUnit). If you?re using xUnit, MbUnit or Gallio ? I recommend you upgrade to this version. Automatic support for 64-bit machines The registry layout on 64-bit machines is plain
Jamie Cansdale
Posted in Uncategorized | No Comments »