Unit testing events with anonymous delegates

24 Jul 2006 The other day I figured out that anonymous delegates can also help you to test an event while staying nicely contained within a single test method. The following is one of the unit tests of the FixedUndoStack class which you can find at my downloads section: [Test] public void TestOnPopEvent()...

Small trap on .NET 2.0 List object

19 Jul 2006 Consider the following small c# 2.0 program: class Program { static void Main(string[] args) { List<int> l = new List<int>(); int i = 0; bool truth = l.TrueForAll(delegate(int z) { i++; return false; }); Console.WriteLine("i is {0} and truth is {1}", i, truth); Console.ReadKey(); } } The delegate passed into...

Log Entry 2711.07.15-2

17 Jul 2006 Met up with Piet. He still got some of that Schnaps he bought last time we visited Terra. Considering the amount we have used of it, there must be a container full of it somewhere on this ship. We went through the usual options. All cargo areas are surveilled by...

A new user - sort of

16 Jul 2006 Welcome my new user, Retro Mandrel grin. Well, he isn't that new of a user. His first (and only) appearance was on my very first webpage back in 97. This guy is Captain of a transporter, the Limelight. A dodgy character, and his crew isn't much better. I had some...

Log Entry 2711.07.15

16 Jul 2006 Apologies for keeping such an irregular log…apologies to whom? Quality inspectors from…which legislation would that be? Terra? Frogbarf? Kemost-scher? So forget about that. The last 2 days were uneventful…uneventful if you get used to the constant fear of loosing the ship in a Meta-Session. Although one has to say that...