コード例 #1
0
        public void CreateTest()
        {
            var typeName = typeof(ConcreteProduct).AssemblyQualifiedName;
            var product  = RawGenericFactory.Create <IProduct>(typeName);

            Assert.AreEqual(typeName, product.GetType().AssemblyQualifiedName);
        }
コード例 #2
0
        public void RawGenericFactoryTest()
        {
            string   typeName = typeof(ConcreteProduct).AssemblyQualifiedName;
            IProduct product  = RawGenericFactory.Create <IProduct>(typeName);

            Assert.IsNotNull(product);
            Assert.AreEqual <string>(typeName, product.GetType().AssemblyQualifiedName);
        }
コード例 #3
0
        public void Test()
        {
            var typeName = typeof(ConcreteProduct).AssemblyQualifiedName;

            Trace.WriteLine(typeName);

            var product = new RawGenericFactory <IProduct>().Create(typeName);

            Assert.IsNotNull(product);
            Assert.IsInstanceOfType(product, typeof(ConcreteProduct));
            Assert.IsTrue(product is IProduct);

            var user = new RawGenericFactory <IUser>().Create(typeof(ConcreteUserA).AssemblyQualifiedName);

            Assert.IsNotNull(user);
            Assert.IsInstanceOfType(user, typeof(ConcreteUserA));
            Assert.IsTrue(user is IUser);
        }