コード例 #1
0
ファイル: TestProgram.cs プロジェクト: dekkerb115/Bam.Net
        public void DaoDataGetSetTest()
        {
            Db.For <TestTable>(new SQLiteDatabase());
            TestTable instance  = new TestTable();
            string    propValue = "ByProperty";

            instance.Name = propValue;
            string value      = 16.RandomLetters();
            string setValue   = instance.ColumnValue <string>("MonkeyBoy", value);
            string checkValue = instance.ColumnValue <string>("MonkeyBoy");

            Expect.AreEqual(value, checkValue);
            dynamic obj = instance.ToDynamic();

            Expect.AreEqual(value, obj.MonkeyBoy);
            dynamic jsonSafe = instance.ToJsonSafe(true);

            Expect.AreEqual(propValue, jsonSafe.Name);
            Expect.AreEqual(value, jsonSafe.MonkeyBoy);
        }