Geeks With Blogs
Adrian Hara Working through the .NET maze March 2008 Entries
Defining NMock2 expectations and unknown parameter values
Disclamer: although I'm pretty convinced there's a better way to do this, I haven't found it, so here goes... Suppose I have this interface: public interface IFoo { int Add(int a, int b); } Now I’d like to mock it (using NMock2), like so: IFoo mock = new Mockery().NewMock<IFoo&g... Expect.Once.On(mock).Method... Is.Anything).Will(Return.Va... Console.WriteLine(mock.Add(5, 6)); Leaving aside why I’d want it to return 10 regardless of the value I add to 5 J, the above doesn’t ......

Posted On Friday, March 28, 2008 6:13 PM

MessageQueue Receive and AppDomain recycling
I've ran into a bit of an issue today that involves MSMQ. I had an Asp.Net webservice who also ran a job (basically a new Thread that loops forever) that was doing a Receive on a MessageQueue object and writing the Message it got (or rather the body of the message) to a database. The business of the job was such that calling Receive, which is synchronous (blocking), was ok. It all worked fine, except that whenever I changed something in the web.config file and the AppDomain would get recycled, the ......

Posted On Wednesday, March 26, 2008 7:50 PM

Copyright © Adrian Hara | Powered by: