public void CallsTheDecorateeOnce() { // Arrange var spy = new SpyGreeter(); var sut = new SimpleDecorator(spy); // Act sut.Greet("name"); // Assert Assert.Equal(1, spy.CallCount); }
public void ForwardsTheCallToDecorateeWithTheName() { // Arrange string name = "Christelle"; var spy = new SpyGreeter(); var sut = new SimpleDecorator(spy); // Act sut.Greet(name); // Assert Assert.Equal(name, spy.SuppliedName); }
public void ProducesExpectedGreet() { // Arrange string name = "John"; string expectedGreet = "<Test Greet>"; var spy = new SpyGreeter { ReturnedGreet = expectedGreet }; var sut = new SimpleDecorator(spy); // Act string actualGreet = sut.Greet(name); // Assert Assert.Equal(expectedGreet, actualGreet); }