private static void Method2ToBenchMark() { AssemblyOpCodeBuilder builder = new AssemblyOpCodeBuilder(); MockClass mock = builder.BuildAssemblyFromType<MockClass>(typeof(MockClass), null); Decorator decorator = new ObjectDecorator(new ObjectInstantiator()); decorator.Decorate<MockClass>(mock); double value = mock.GetZero(); }
private static void Method2ToBenchMark() { AssemblyOpCodeBuilder builder = new AssemblyOpCodeBuilder(); MockClass mock = builder.BuildAssemblyFromType <MockClass>(typeof(MockClass), null); Decorator decorator = new ObjectDecorator(new ObjectInstantiator()); decorator.Decorate <MockClass>(mock); double value = mock.GetZero(); }
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); }
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); }
public void MyTestInitialize() { builder = new AssemblyOpCodeBuilder(); }
public void MyTestCleanup() { builder = null; }
public void MyTestCleanup() { builder = null; }
public void MyTestInitialize() { builder = new AssemblyOpCodeBuilder(); }