Пример #1
0
        public static void GetSchemaAndTestVariousTypes(ICRUDDataStore store)
        {
            var schema = store.GetSchema(new Query("CRUD.Types.Load"));

            var row = new DynamicRow(schema);

            row["GDID"]        = new GDID(0, 145);
            row["SCREEN_NAME"] = "User1";
            row["STRING_NAME"] = "Some user 1";
            row["CHAR_NAME"]   = "Some user 2";
            row["BOOL_CHAR"]   = 'T';
            row["BOOL_BOOL"]   = true;

            row["AMOUNT"] = 145670.23m;

            row["DOB"] = new DateTime(1980, 12, 1);

            store.Insert(row);

            var row2 = store.LoadOneRow(new Query("CRUD.Types.Load", new GDID(0, 145)));

            Assert.NotNull(row2);
            Assert.AreEqual(145, row2["GDID"]);
            Assert.AreEqual("User1", row2["Screen_Name"]);
            Assert.AreEqual("Some user 1", row2["String_Name"]);
            Assert.AreEqual("Some user 2", row2["Char_Name"]);

            Assert.AreEqual(true, row2["BOOL_Char"].AsBool());
            Assert.AreEqual(true, row2["BOOL_BOOL"].AsBool());

            Assert.AreEqual(145670.23m, row2["Amount"]);

            Assert.AreEqual(1980, row2["DOB"].AsDateTime().Year);
        }
Пример #2
0
        public static void GetSchemaAndTestFullGDID(ICRUDDataStore store)
        {
            var schema = store.GetSchema(new Query("CRUD.FullGDID.Load"));

            var row = new DynamicRow(schema);

            var key = new GDID(179, 1, 1234567890);

            Console.WriteLine(key.Bytes.ToDumpString(DumpFormat.Hex));

            row["GDID"] = new GDID(179, 1, 1234567890);
            Console.WriteLine(((byte[])row["GDID"]).ToDumpString(DumpFormat.Hex));

            row["VARGDID"]     = new GDID(12, 9, 9876543210);
            row["STRING_NAME"] = "DA DA DA!";

            store.Insert(row);

            var row2 = store.LoadOneRow(new Query("CRUD.FullGDID.Load", key, typeof(FullGDID))) as FullGDID;

            Assert.NotNull(row2);
            Assert.AreEqual(key, row2.GDID);
            Assert.AreEqual(new GDID(12, 9, 9876543210), row2.VARGDID);
            Assert.AreEqual("DA DA DA!", row2["String_Name"]);
        }
Пример #3
0
        public static void GetSchemaAndTestFullGDID(ICRUDDataStore store)
        {
            var schema = store.GetSchema(new Query("CRUD.FullGDID.Load"));
                
            var row = new DynamicRow(schema);

            var key = new GDID(179, 1, 1234567890);
            Console.WriteLine( key.Bytes.ToDumpString(DumpFormat.Hex));

            row["GDID"] = new GDID(179, 1, 1234567890);
            Console.WriteLine( ((byte[])row["GDID"]).ToDumpString(DumpFormat.Hex) );

            row["VARGDID"] = new GDID(12, 9, 9876543210);
            row["STRING_NAME"] = "DA DA DA!";

            store.Insert( row );

            var row2 = store.LoadOneRow(new Query("CRUD.FullGDID.Load", key, typeof(FullGDID))) as FullGDID;

            Assert.NotNull(row2);
            Assert.AreEqual(key, row2.GDID);
            Assert.AreEqual(new GDID(12, 9, 9876543210), row2.VARGDID);
            Assert.AreEqual("DA DA DA!", row2["String_Name"]);
        }
Пример #4
0
        public static void GetSchemaAndTestVariousTypes(ICRUDDataStore store)
        {
            var schema = store.GetSchema(new Query("CRUD.Types.Load"));
                
            var row = new DynamicRow(schema);
            row["GDID"] = new GDID(0, 145);
            row["SCREEN_NAME"] = "User1";
            row["STRING_NAME"] = "Some user 1";
            row["CHAR_NAME"] = "Some user 2";
            row["BOOL_CHAR"] = 'T'; 
            row["BOOL_BOOL"] = true;

            row["AMOUNT"] = 145670.23m;

            row["DOB"] = new DateTime(1980,12,1);

            store.Insert( row );

            var row2 = store.LoadOneRow(new Query("CRUD.Types.Load", new GDID(0, 145)));

            Assert.NotNull(row2);
            Assert.AreEqual(145, row2["GDID"]);
            Assert.AreEqual("User1", row2["Screen_Name"]);
            Assert.AreEqual("Some user 1", row2["String_Name"]);
            Assert.AreEqual("Some user 2", row2["Char_Name"]);

            Assert.AreEqual(true, row2["BOOL_Char"].AsBool());
            Assert.AreEqual(true, row2["BOOL_BOOL"].AsBool());

            Assert.AreEqual(145670.23m, row2["Amount"]);

            Assert.AreEqual(1980, row2["DOB"].AsDateTime().Year);

            
        }