public void Apply_WhenNull() { var target = new ReverseBehavior(); var result = target.Apply(null); Assert.AreEqual(String.Empty, result); }
public void Apply() { const string someText = "someText"; var target = new ReverseBehavior(); var result = target.Apply(someText); Assert.AreEqual(someText.Reverse(), result); }
public static void Main(string[] args) { var reverser = new ReverseBehavior(); var exceptionDecorator = new ExceptionDecorator(reverser); var loggingDecorator = new LoggingDecorator(exceptionDecorator); var threadingDecorator = new ThreadingDecorator(loggingDecorator); var timerDecorator = new TimerDecorator(threadingDecorator); //var nullDecorator = new NullDecorator(timerDecorator); var result = timerDecorator.Apply("abc"); Console.WriteLine(result); Console.ReadKey(); }