Exemplo n.º 1
0
        public static void ASYNC_GetSchemaAndTestVariousTypes(ICRUDDataStore store)
        {
            var schema = store.GetSchemaAsync(new Query("CRUD.Types.Load")).Result;

            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);
        }
Exemplo n.º 2
0
        public static void ASYNC_GetSchemaAndTestVariousTypes(ICRUDDataStore store)
        {
            var schema = store.GetSchemaAsync(new Query("CRUD.Types.Load")).Result;

            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);
        }