C# · Dotnet

Refactoring: Enums with ExtensionMethods

Dear Reader, Today i had to do some unit testing of a class which had some private instance and static methods along with non privates in it. These methods had some good core logic in it which i determined to do unit testing. Though many articles and experts say that its ok not to do… Continue reading Refactoring: Enums with ExtensionMethods

C# · Dotnet

Replacing Conditional statements with Inheritance

Dear Reader, Today while i was lurking at stackoverflow, i stumbled upon this question. In my discussion with the author, he had asked me give him a small code snippet for replacing his conditional statement i.e switch. So below is the code i gave away. As discussed in the SO thread, this solution has to… Continue reading Replacing Conditional statements with Inheritance