コード例 #1
0
        public void TestHasColumn()
        {
            TestingClass tc = new TestingClass();

            Assert.True(new ColumnMap().HasColumn(tc, "Test"));
            Assert.False(new ColumnMap().HasColumn(tc, "tt"));
            Assert.False(new ColumnMap().HasColumn(tc, ""));
            Assert.False(new ColumnMap().HasColumn(tc, null));
        }
コード例 #2
0
        public void TestSetValueWithDouble()
        {
            TestingClass tc = new TestingClass();

            new ColumnMap().SetValue(tc, "doubleTest", DBNull.Value);
            Assert.AreEqual(tc.doubleTest, 0.0d);

            new ColumnMap().SetValue(tc, "doubleTest", DBNull.Value);
            Assert.AreNotEqual(tc.doubleTest, "");
        }
コード例 #3
0
        public void TestSetValueWithDecimal()
        {
            TestingClass tc = new TestingClass();

            new ColumnMap().SetValue(tc, "decimalTest", DBNull.Value);
            Assert.AreEqual(tc.decimalTest, 0.0M);

            new ColumnMap().SetValue(tc, "decimalTest", DBNull.Value);
            Assert.AreNotEqual(tc.decimalTest, "");
        }
コード例 #4
0
        public void TestSetValueWithBool()
        {
            TestingClass tc = new TestingClass();

            new ColumnMap().SetValue(tc, "boolTest", true);
            Assert.AreEqual(tc.boolTest, true);

            new ColumnMap().SetValue(tc, "boolTest", DBNull.Value);
            Assert.AreNotEqual(tc.boolTest, true);
        }
コード例 #5
0
        public void TestSetValueWithString()
        {
            TestingClass tc = new TestingClass();

            new ColumnMap().SetValue(tc, "stringTest", "test_String");
            Assert.AreEqual(tc.stringTest, "test_String");

            new ColumnMap().SetValue(tc, "stringTest", DBNull.Value);
            Assert.AreEqual(tc.stringTest, "");
        }
コード例 #6
0
        public void TestSetValueWithInt()
        {
            TestingClass tc = new TestingClass();

            new ColumnMap().SetValue(tc, "intTest", 21);
            Assert.AreEqual(tc.intTest, 21);

            new ColumnMap().SetValue(tc, "intTest", DBNull.Value);
            Assert.AreEqual(tc.intTest, 0);
        }
コード例 #7
0
        public void TestSetValueWithFloat()
        {
            TestingClass tc = new TestingClass();

            new ColumnMap().SetValue(tc, "floatTest", DBNull.Value);
            Assert.AreEqual(tc.floatTest, 0.0f);

            new ColumnMap().SetValue(tc, "floatTest", DBNull.Value);
            Assert.AreNotEqual(tc.floatTest, "");
        }