Ejemplo n.º 1
0
        public void TestReflectedClassCreation()
        {
            var factory = new ReflectionFactory();
            var reflectedClass = factory.Create(typeof(MockIClassWithoutAttributes));

            Assert.NotNull(reflectedClass);
        }
Ejemplo n.º 2
0
        public void TestPostConstructor()
        {
            var factory = new ReflectionFactory();
            var reflectedClass = factory.Create(typeof(MockIClassWithAttributes));

            Assert.AreEqual(1, reflectedClass.postConstructors.Length);
        }
Ejemplo n.º 3
0
        public void TestInjectProperty()
        {
            var factory = new ReflectionFactory();
            var reflectedClass = factory.Create(typeof(MockIClassWithAttributes));

            Assert.AreEqual(1, reflectedClass.properties.Length);
        }
Ejemplo n.º 4
0
        public void TestConstructorWhenNoConstruct()
        {
            var factory = new ReflectionFactory();
            var reflectedClass = factory.Create(typeof(MockIClassWithoutAttributes));

            Assert.NotNull(reflectedClass.constructor);
            Assert.AreEqual(0, reflectedClass.constructorParameters.Length);
        }
Ejemplo n.º 5
0
        public void TestConstructorWithConstruct()
        {
            var factory = new ReflectionFactory();
            var reflectedClass = factory.Create(typeof(MockIClassWithAttributes));

            Assert.IsNull(reflectedClass.constructor);
            Assert.NotNull(reflectedClass.paramsConstructor);
            Assert.AreEqual(1, reflectedClass.constructorParameters.Length);
            Assert.AreEqual(typeof(MockClassToDepend), reflectedClass.constructorParameters[0].type);
        }