public void ShouldImplementPropertiesAndDecorateThem() { MockInjectable actual = builder.BuildAssemblyFromType <MockInjectable>(typeof(MockInjectable), null); Decorator decorator = new ObjectDecorator(new ObjectInstantiator()); decorator.Decorate <MockInjectable>(actual); Assert.IsNotNull(actual.Earth); }
public void DecoratePropertyTest() { AssemblyOpCodeBuilder builder = new AssemblyOpCodeBuilder(); MockInjectable mock = builder.BuildAssemblyFromType <MockInjectable>(typeof(MockInjectable), null); Decorator decorator = new ObjectDecorator(new ObjectInstantiator()); decorator.Decorate <MockInjectable>(mock); Assert.IsNotNull(mock.Fire); Assert.IsTrue(mock.Fire is Fire); Assert.IsNotNull(mock.Water); Assert.IsTrue(mock.Water is Water); Assert.IsNotNull(mock.Earth); Assert.IsTrue(mock.Earth is Earth); }