Exemple #1
0
        public static object Object(Type t)
        {
            var o = CreateNew.Instance(t);

            SetRandom.Values(o);
            return(o);
        }
Exemple #2
0
        public static T Object <T>()
        {
            var o = CreateNew.Instance <T>();

            SetRandom.Values(o);
            return(o);
        }
        private static void TestCreate <T>()
        {
            var o = CreateNew.Instance <T>();

            Assert.IsNotNull(o);
            Assert.IsInstanceOfType(o, typeof(T));
        }
        private static void TestCreate(Type t)
        {
            var o = CreateNew.Instance(t);

            Assert.IsNotNull(o);
            Assert.IsInstanceOfType(o, t);
        }
Exemple #5
0
        public void OnPostEditTestIsCallingUpdate()
        {
            var o = CreateNew.Instance <TView>();

            OnPostEditAsync(o.Id, o);
            Assert.AreEqual($"Update {o.Id}", MockRepo.Actions[0]);
        }
Exemple #6
0
        public void OnPostCreateTestIsCallingAdd()
        {
            var o = CreateNew.Instance <TView>();

            OnPostCreateAsync(o);
            Assert.AreEqual($"Add {o.Id}", MockRepo.Actions[0]);
        }
Exemple #7
0
        public void InstanceWithDefaultConstructorTest()
        {
            var o1 = CreateNew.Instance <testClass2>();
            var o2 = CreateNew.Instance <testClass2>();

            Assert.IsInstanceOfType(o1, typeof(testClass2));
            Assert.AreNotEqual(o1.S, o2.S);
            Assert.AreNotEqual(o1.I, o2.I);
        }
Exemple #8
0
        public void InstanceTest()
        {
            var o1 = CreateNew.Instance <testClass1>();
            var o2 = CreateNew.Instance <testClass1>();

            Assert.IsInstanceOfType(o1, typeof(testClass1));
            Assert.AreNotEqual(o1.S, o2.S);
            Assert.AreNotEqual(o1.I, o2.I);
        }
Exemple #9
0
        public void CreateDefaultTest()
        {
            var o1 = CreateNew.Instance <TestClass2>();
            var o2 = CreateNew.Instance <TestClass2>();

            Assert.IsInstanceOfType(o1, typeof(TestClass2));
            Assert.AreNotEqual(o1.S, o2.S);
            Assert.AreNotEqual(o1.I, o2.I);
        }
Exemple #10
0
        public void InstanceIsEnumTest()
        {
            var s = CreateNew.Instance <IsoGender>();

            Assert.IsInstanceOfType(s, typeof(IsoGender));
        }
Exemple #11
0
        public void InstanceIsStringTest()
        {
            var s = CreateNew.Instance <string>();

            Assert.IsInstanceOfType(s, typeof(string));
        }