Browse by Tags
All Tags »
C# (
RSS)
I was working on some code today, when run into a pitfall with Moq. This was probably my misreading of documentation. The component I was testing looked somewhat like the code below public class SomeOtherType { private readonly ISomeType someType; public...
Base classes are a touchy subject . Some might advocate for it, some will against it. Personally, I am not a big fan of base classes. There are several reasons for that, but most important to me, is the baggage you get to carry around once extend a base...
Several last projects I used a simple IoC container, leveraging Activator.CreateInstance(type). The main reason - simplicity. Once there was a need to go to a higher level, I would switch to Windsor Container. One of the projects used Unity. The only...
Enumerations are for enumeration. Obvious. Often, though, it's used also for some metadata knowledge. For example, an enumeration for gender might look like: public enum Gender { Male, Female } .csharpcode, .csharpcode pre { font-size: small; color: black;...
More Posts