Exemplo n.º 1
0
 public void Should_not_possible_to_compare_elements_with_null_value()
 {
     IntegerComparator comparator = new IntegerComparator();
     bool compareResult = comparator.Compare("180", null, OperationEnumeration.greaterthan);
 }
Exemplo n.º 2
0
        public void Should_be_possibe_to_compare_two_integers_using_not_equals_operator()
        {
            IntegerComparator comparator = new IntegerComparator();

            bool compareResult = comparator.Compare("15899", "525", OperationEnumeration.notequal);
            Assert.IsTrue(compareResult, "the value is not expected for not equals operation");

            compareResult = comparator.Compare("18", "18", OperationEnumeration.notequal);
            Assert.IsFalse(compareResult, "the value is not expected for not equals operation");
        }
Exemplo n.º 3
0
 public void Should_not_possible_to_compare_elements_that_is_not_integer_with_any_operator()
 {
     IntegerComparator comparator = new IntegerComparator();
     bool compareResult = comparator.Compare("Is not Integer", "10", OperationEnumeration.lessthan);
 }
Exemplo n.º 4
0
        public void Should_be_possible_to_compare_two_integers_using_less_than_or_equals_operator()
        {
            IntegerComparator comparator = new IntegerComparator();

            bool compareResult = comparator.Compare("9", "10", OperationEnumeration.lessthanorequal);
            Assert.IsTrue(compareResult, "the value is not expected for less than equal operation");

            compareResult = comparator.Compare("96", "96", OperationEnumeration.lessthanorequal);
            Assert.IsTrue(compareResult, "the value is not expected for less than or equal operation");
        }
Exemplo n.º 5
0
        public void Should_be_possible_to_compare_two_integers_using_greater_than_or_equals_operator()
        {
            IntegerComparator comparator = new IntegerComparator();

            bool compareResult = comparator.Compare("181", "180", OperationEnumeration.greaterthanorequal);
            Assert.IsTrue(compareResult, "the value is not expected for greater than or equal operation");

            compareResult = comparator.Compare("8", "8", OperationEnumeration.greaterthanorequal);
            Assert.IsTrue(compareResult, "the value is not expected for greater than or equal operation");
        }
Exemplo n.º 6
0
        public void Should_be_possible_to_compare_two_integers_using_bitwise_or_operator()
        {
            IntegerComparator comparator = new IntegerComparator();

            bool compareResult = comparator.Compare("14", "6", OperationEnumeration.bitwiseor);
            Assert.IsTrue(compareResult, "the value is not expected for less than equal operation");

            compareResult = comparator.Compare("14", "1", OperationEnumeration.bitwiseor);
            Assert.IsFalse(compareResult, "the value is not expected for less than equal operation");
        }
Exemplo n.º 7
0
        public void Should_be_possible_to_compare_two_integers_using_bitwise_and_operator_2()
        {
            var comparisionResult = new IntegerComparator().Compare("519", "2", OperationEnumeration.bitwiseand);

            Assert.IsTrue(comparisionResult);
        }