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)); }
public void BooleanTypeNotEqualToOtherType() { var type1 = new SqlBooleanType(SqlTypeCode.Boolean); var type2 = new SqlBinaryType(SqlTypeCode.Binary); Assert.False(type1.Equals(type2)); }
public void Serialize(SqlTypeCode typeCode) { var type = new SqlBooleanType(typeCode); var result = BinarySerializeUtil.Serialize(type); Assert.Equal(type, result); }
public void GetString(SqlTypeCode typeCode, string expected) { var type = new SqlBooleanType(typeCode); var s = type.ToString(); Assert.Equal(expected, s); }
public static void FalseToString() { var type = new SqlBooleanType(SqlTypeCode.Boolean); var value = SqlBoolean.False; var s = type.ToSqlString(value); Assert.Equal("FALSE", s); }
public static void TrueToString() { var type = new SqlBooleanType(SqlTypeCode.Boolean); var value = SqlBoolean.True; var s = type.ToSqlString(value); Assert.Equal("TRUE", s); }
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); }
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); }
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); }
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)); }