コード例 #1
0
        /// <summary>
        ///A test for Construct
        ///</summary>
        public void ConstructTestHelper <T>()
        {
            AbstractObjectBuilder <T> target = new AbstractObjectBuilder <T>(value);
            T actual;

            actual = target.Construct(type, null);
            Assert.IsNotNull(actual);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: skylerparr/SharpWeld
        private static void Method1ToBenchMark()
        {
            AbstractObjectBuilder<MockClass> builder = new AbstractObjectBuilder<MockClass>(new AssemblyBuilder(new CSharpProvider()));
            MockClass mock = builder.Construct(typeof(MockClass), null);
            Decorator decorator = new ObjectDecorator(new ObjectInstantiator());
            decorator.Decorate<MockClass>(mock);

            double value = mock.GetZero();
        }
コード例 #3
0
        public void ShouldInterruptTheAbstractMethodAndUseAttributeFunction()
        {
            AbstractObjectBuilder<MockClass> builder = new AbstractObjectBuilder<MockClass>(new AssemblyBuilder(new CSharpProvider()));
            MockClass mock = builder.Construct(typeof(MockClass), null);
            Decorator decorator = new ObjectDecorator(new ObjectInstantiator());
            decorator.Decorate<MockClass>(mock);

            Assert.AreEqual("some1helpme", mock.DoSomeMagic("some", 1, "helpme"));
        }
コード例 #4
0
        /// <summary>
        ///A test for Construct
        ///</summary>
        public T ConstructDiscreteHelper <T>()
        {
            AbstractObjectBuilder <T> target = new AbstractObjectBuilder <T>(value);
            T actual;

            actual = target.Construct(type, null);
            Assert.IsNotNull(actual);
            return(actual);
        }
コード例 #5
0
        public void ShouldInterruptTheAbstractMethodAndUseAttributeFunction()
        {
            AbstractObjectBuilder <MockClass> builder = new AbstractObjectBuilder <MockClass>(new AssemblyBuilder(new CSharpProvider()));
            MockClass mock      = builder.Construct(typeof(MockClass), null);
            Decorator decorator = new ObjectDecorator(new ObjectInstantiator());

            decorator.Decorate <MockClass>(mock);

            Assert.AreEqual("some1helpme", mock.DoSomeMagic("some", 1, "helpme"));
        }
コード例 #6
0
        private static void Method1ToBenchMark()
        {
            AbstractObjectBuilder <MockClass> builder = new AbstractObjectBuilder <MockClass>(new AssemblyBuilder(new CSharpProvider()));
            MockClass mock      = builder.Construct(typeof(MockClass), null);
            Decorator decorator = new ObjectDecorator(new ObjectInstantiator());

            decorator.Decorate <MockClass>(mock);

            double value = mock.GetZero();
        }