Browse by Tags

All Tags » C# (RSS)
Mocking HttpRequest and HttpResponse is not complicated with HttpRequestBase and HttpResponseBase introduced in ASP.NET. I had to mock ServerVariables property of HttpRequest and run into an issue – I was accessing an indexer property and didn’t know...
Posted by Sean Feldman | 2 comment(s)
Filed under: ,
Writing a Custom ConfigurationSection is not a big task, but can be very challenging if you forget some details. I loved this post as it reminded me that you have to have both the Section tag and the collection within it tag… dah!
Posted by Sean Feldman | 2 comment(s)
Filed under:
Asserting arguments is essentially a healthy practice. What I don’t like, is the fact that since day one ArgumentNullException used a string for argument name, and now with .NET 4.5 almost knocking on the door, there’s still only string option. if (x...
Posted by Sean Feldman | 14 comment(s)
Filed under:
A few years ago I have blogged about Singletonitis . Another place, different people, yet the same problem appears again – singletonitis. The issues I have outlined back then where 1. Testing 2. Difficulty to replace implementation 3. Requirement to track...
Posted by Sean Feldman | 5 comment(s)
Filed under: , , ,
When doing testing, I tend to create an object mother for the items generated multiple times for specifications. Quite often these objects need to be a part of a collection. A neat way to do so is to leverage .NET params mechanism: public static IEnumerable<T>...
Posted by Sean Feldman | 6 comment(s)
Filed under:
Row tests are fun. You can simulate various inputs with expected outputs and execute them all with a single observation (test). The problem for myself was always the fact that when this was done, the only way to accomplish it was to merge the logical...
Posted by Sean Feldman | with no comments
Filed under: ,
In my previous blog about consuming WCF service from BizTalk orchestration I wrote about how we’d invoke a service based on a document coming in and mapping it into the service request schema. This time I had the input for the service coming from a context...
Posted by Sean Feldman | 2 comment(s)
Filed under: , ,

AOP

I am looking at the code for Silverlight application and there’s something that just bugs me… INotifyPropertyChanged. This is not the first time, and yet again I see this interface implemented again, and again, and again. This violates several good principles...
Posted by Sean Feldman | 2 comment(s)
Filed under: , , ,
This is something trivial, yet got me to think for a little. I had two checksums, one received from a client invoking a service, another one calculated once data sent into service is received. Checksums are plain arrays of bytes. I wanted to have comparison...
Posted by Sean Feldman | with no comments
Filed under:
log4net is a great facility to create logs. When it comes to extending it, it’s good as well. To add a custom property to a custom appender that can be configured from configuration XML file is so simple, that it even looks suspicious. Custom appender...
Posted by Sean Feldman | with no comments
Filed under:
More Posts Next page »