Esempio n. 1
0
        public void TN_Class_Parameters()
        {
            const int    expectedNum    = int.MaxValue;
            const string expectedText   = "test";
            var          createInstance = TypeNew.GetCreateInstance <object, int, string>(typeof(TClassWithParam), typeof(int), typeof(string));

            Assert.Multiple(() =>
            {
                var obj   = createInstance(expectedNum, expectedText);
                var value = obj as TClassWithParam;
                Assert.IsInstanceOf <TClassWithParam>(obj);
                Assert.NotNull(value);
                Assert.AreEqual(expectedNum, value.i);
                Assert.AreSame(expectedText, value.text);
            });
        }
Esempio n. 2
0
 public void SetUp()
 {
     typeNew    = TypeNew.GetCreateInstance <Example>(typeof(Example));
     typeNewBox = TypeNew.GetCreateInstance(typeof(Example));
 }
Esempio n. 3
0
        public void TN_Struct_Generic()
        {
            var createInstance = TypeNew.GetCreateInstance <TStruct>(typeof(TStruct));

            Assert.NotNull(createInstance());
        }
Esempio n. 4
0
        public void TN_Class_Generic_DerivedClass()
        {
            var createInstance = TypeNew.GetCreateInstance <TAbstractClass>(typeof(TDerivedClass));

            Assert.NotNull(createInstance());
        }
Esempio n. 5
0
        public void TN_Class_Generic()
        {
            var createInstance = TypeNew.GetCreateInstance <TClass>(typeof(TClass));

            Assert.NotNull(createInstance());
        }
Esempio n. 6
0
        public void TN_Object_Generic()
        {
            var createInstance = TypeNew.GetCreateInstance <object>(typeof(object));

            Assert.NotNull(createInstance);
        }