Esempio n. 1
0
        public static void TestClass1TwoGenericInheritedMembersDefaultValue()
        {
            var o = new DataClass1 <int, decimal>();

            Assert.AreEqual(0, o.Value1, "int 1");
            Assert.AreEqual(0m, o.Value2, "decimal 2");

            var o1 = new DataClass1 <long, bool>();

            Assert.AreEqual(0L, o1.Value1, "long 1");
            Assert.AreEqual(false, o1.Value2, "bool 2");

            var o2 = new DataClass1 <double, string>();

            Assert.AreEqual(0, o2.Value1, "double 1");
            Assert.Null(o2.Value2, "string 2");
        }
Esempio n. 2
0
        public DataClass1 GetData()
        {
            DataClass1 ret = new DataClass1();

            ret.Reportsrc  = new Dictionary <int, Reportrec>();
            ret.Reportsrc2 = new List <Reportrec>();

            // create report data
            for (int i = 0; i < 50; i++)
            {
                ret.Reportsrc.Add(i, new Reportrec()
                {
                    id = i, message = "record=" + i
                });

                ret.Reportsrc2.Add(new Reportrec()
                {
                    id = i, message = "22record=" + i
                });
            }

            return(ret);
        }