C#

  • Composite

    Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Component: This is the abstract object that represents any and all members of the pattern Composite: Derives from component and provides the definition for the class that contains other components Leaf: A concrete node that encapsulates…

  • Command

    Quick Information/Overview Pattern Type Behavioral Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy – Moderate Up Front Definitions Invoker: This object services clients by exposing a method that takes a command as a parameter and invoking the command’s execute Receiver: This is the object upon which commands are performed – its state…

  • Poor Man’s Automoq in .NET 4

    So, the other day I mentioned to a coworker that I was working on a tool that would wrap moq and provide expressive test double names. I then mentioned the tool AutoMoq, and he showed me something that he was doing. It’s very simple: [TestClass] public class FeatureResetServiceTest { #region Builders private static FeatureResetService BuildTarget(IFeatureLocator…