public void ProducesExpectedGreet()
        {
            // Arrange
            string name          = "John";
            string expectedGreet = "Hello, John. Nice to meet you.";

            var sut = new NiceToMeetYouGreeterDecorator(new FormalGreeter());

            // Act
            string actualGreet = sut.Greet(name);

            // Assert
            Assert.Equal(expectedGreet, actualGreet);
        }
Example #2
0
        public static void Main(string[] args)
        {
            // ---- Start code Section 9.1.1 ----
            IGreeter greeter =
                new NiceToMeetYouGreeterDecorator(
                    new TitledGreeterDecorator(
                        new FormalGreeter()));

            string greet = greeter.Greet("Samuel L. Jackson");

            System.Console.WriteLine(greet);
            // ---- End code Section 9.1.1 ----

            System.Console.ReadLine();
        }