コード例 #1
0
        public void BooleanTypesEqual(SqlTypeCode typeCode1, SqlTypeCode typeCode2, bool expected)
        {
            var type1 = new SqlBooleanType(typeCode1);
            var type2 = new SqlBooleanType(typeCode2);

            Assert.Equal(expected, type1.Equals(type2));
        }
コード例 #2
0
        public void BooleanTypeNotEqualToOtherType()
        {
            var type1 = new SqlBooleanType(SqlTypeCode.Boolean);
            var type2 = new SqlBinaryType(SqlTypeCode.Binary);

            Assert.False(type1.Equals(type2));
        }
コード例 #3
0
        public void Serialize(SqlTypeCode typeCode)
        {
            var type = new SqlBooleanType(typeCode);

            var result = BinarySerializeUtil.Serialize(type);

            Assert.Equal(type, result);
        }
コード例 #4
0
        public void GetString(SqlTypeCode typeCode, string expected)
        {
            var type = new SqlBooleanType(typeCode);

            var s = type.ToString();

            Assert.Equal(expected, s);
        }
コード例 #5
0
        public static void FalseToString()
        {
            var type = new SqlBooleanType(SqlTypeCode.Boolean);

            var value = SqlBoolean.False;
            var s     = type.ToSqlString(value);

            Assert.Equal("FALSE", s);
        }
コード例 #6
0
        public static void TrueToString()
        {
            var type = new SqlBooleanType(SqlTypeCode.Boolean);

            var value = SqlBoolean.True;
            var s     = type.ToSqlString(value);

            Assert.Equal("TRUE", s);
        }
コード例 #7
0
        public static void Multiply()
        {
            var a    = SqlBoolean.True;
            var b    = SqlBoolean.False;
            var type = new SqlBooleanType(SqlTypeCode.Boolean);

            var result = type.Multiply(a, b);

            Assert.IsType <SqlNull>(result);
        }
コード例 #8
0
        public static void Negate(bool value, bool expected)
        {
            var b    = (SqlBoolean)value;
            var type = new SqlBooleanType(SqlTypeCode.Boolean);

            var result = type.Negate(b);
            var exp    = (SqlBoolean)expected;

            Assert.Equal(exp, result);
        }
コード例 #9
0
        public static void NotEqual(bool a, bool b, bool expected)
        {
            var x    = (SqlBoolean)a;
            var y    = (SqlBoolean)b;
            var type = new SqlBooleanType(SqlTypeCode.Boolean);

            var result = type.NotEqual(x, y);
            var exp    = (SqlBoolean)expected;

            Assert.Equal(exp, result);
        }
コード例 #10
0
        public void Compare_Booleans()
        {
            var type = new SqlBooleanType(SqlTypeCode.Boolean);

            Assert.NotNull(type);

            Assert.Equal(1, type.Compare(SqlBoolean.True, SqlBoolean.False));
            Assert.Equal(-1, type.Compare(SqlBoolean.False, SqlBoolean.True));
            Assert.Equal(0, type.Compare(SqlBoolean.True, SqlBoolean.True));
            Assert.Equal(0, type.Compare(SqlBoolean.False, SqlBoolean.False));
        }