Editor reviews are provided by professional editors who evaluate a blog based on the following criteria: Frequency of Updates, Relevance of Content, Site Design, and Writing Style.
User rating is calculated as an average of the user ratings. If this rating differs significantly from our editor's rating our editors may re-evaluate this blog.
I need to use an embedded DB in a project. Naturally, I turned to my old friend, SQLite. It has served me well in the past, and I am well versed in all its tricks. Except... SQLite really fall apart when you are talking about even moderately multi threaded applications. By that I mean, it works just as advertised, for sure. It just lock the entire DB when used, which tend to kill other threads who...
I mentioned before that Rhino Mocks is a very powerful framework. This can be a problem at times, because it make it hard to notice that you cross the line into mock abuse. Let us look at this test for example: [Test] public void Will_raise_message_arrived_event_for_each_message_in_batch_and_across_batches() { var stubbedIncomingMessageRepository = MockRepository.GenerateStub<IIncomingMessageRep...
Here is why I love Rhino Mocks. This is a test that utilize quite a bit of the underlying power of Rhino Mocks. Check this out: [Test] public void For_each_batch_from_repository_will_create_and_execute_command() { var stubbedCommand = MockRepository.GenerateMock<ICommand>(); var mocks = new MockRepository(); var queueProcessor = mocks.PartialMock<QueueProcessor>( stubbedQueueFactory, st...
One of the major pain points for me in Rhino Mocks has always been the Callback() and Do() delegates. I designed them at the 1.1 days, when we didn't have such things as anonymous delegates or lambda. As a result, they required you to explicitly pass a delegate type, where a pain to use and major eye sore. For a long time, I accepted that there is nothing to do. The fault was with the annoying comp...
Let us assume that we have the following piece of code. It has a big problem in it. The kind of problem that you get called at 2 AM to solve. Can you find it? (more below) public static void Main() { while(true) { srv.ProcessMessages(); Thread.Sleep(5000); } } public void ProcessMessages() { try { var msgs = GetMessages(); byte[] data = Serialize(msgs); var req = WebRequest.Create("http://some.remo...