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 ......
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 ......