Exemplo n.º 1
0
        public void NotEquals()
        {
            SqlBoolean sqlTrue2 = new SqlBoolean(true);

            SqlBoolean sqlResult;

            // true != false
            sqlResult = SqlBoolean.NotEquals(_sqlTrue, _sqlFalse);
            Assert.True(sqlResult.Value);
            sqlResult = SqlBoolean.NotEquals(_sqlFalse, _sqlTrue);
            Assert.True(sqlResult.Value);


            // true != true
            sqlResult = SqlBoolean.NotEquals(_sqlTrue, _sqlTrue);
            Assert.False(sqlResult.Value);
            sqlResult = SqlBoolean.NotEquals(_sqlTrue, sqlTrue2);
            Assert.False(sqlResult.Value);
            // false != false
            sqlResult = SqlBoolean.NotEquals(_sqlFalse, _sqlFalse);
            Assert.False(sqlResult.Value);
            sqlResult = SqlBoolean.NotEquals(_sqlTrue, sqlTrue2);
            Assert.False(sqlResult.Value);

            // If either instance of SqlBoolean is null, the Value of the SqlBoolean will be Null.
            sqlResult = SqlBoolean.NotEquals(SqlBoolean.Null, _sqlFalse);
            Assert.True(sqlResult.IsNull);
            sqlResult = SqlBoolean.NotEquals(_sqlTrue, SqlBoolean.Null);
            Assert.True(sqlResult.IsNull);
        }
Exemplo n.º 2
0
        public void NotEquals()
        {
            SqlBoolean SqlTrue2  = new SqlBoolean(true);
            SqlBoolean SqlFalse2 = new SqlBoolean(false);

            SqlBoolean SqlResult;

            // true != false
            SqlResult = SqlBoolean.NotEquals(SqlTrue, SqlFalse);
            Assert.IsTrue(SqlResult.Value, "NotEquals method does not work correctly (true != false)");
            SqlResult = SqlBoolean.NotEquals(SqlFalse, SqlTrue);
            Assert.IsTrue(SqlResult.Value, "NotEquals method does not work correctly (false != true)");


            // true != true
            SqlResult = SqlBoolean.NotEquals(SqlTrue, SqlTrue);
            Assert.IsTrue(!SqlResult.Value, "NotEquals method does not work correctly (true != true)");
            SqlResult = SqlBoolean.NotEquals(SqlTrue, SqlTrue2);
            Assert.IsTrue(!SqlResult.Value, "NotEquals method does not work correctly (true != true2)");
            // false != false
            SqlResult = SqlBoolean.NotEquals(SqlFalse, SqlFalse);
            Assert.IsTrue(!SqlResult.Value, "NotEquals method does not work correctly (false != false)");
            SqlResult = SqlBoolean.NotEquals(SqlTrue, SqlTrue2);
            Assert.IsTrue(!SqlResult.Value, "NotEquals method does not work correctly (false != false2)");

            // If either instance of SqlBoolean is null, the Value of the SqlBoolean will be Null.
            SqlResult = SqlBoolean.NotEquals(SqlBoolean.Null, SqlFalse);
            Assert.IsTrue(SqlResult.IsNull, "NotEquals method does not work correctly (Null != false)");
            SqlResult = SqlBoolean.NotEquals(SqlTrue, SqlBoolean.Null);
            Assert.IsTrue(SqlResult.IsNull, "NotEquals method does not work correctly (false != Null)");
        }