예제 #1
0
        public void Test_CompareTo_WhenNotInValues_ShouldReturnNotZero()
        {
            //-------------Setup Test Pack ------------------
            object[] values = new object[] { "100", "200", "300" };
            Criteria.CriteriaValues criteriaValues = new Criteria.CriteriaValues(values);

            //-------------Execute test ---------------------
            int result = criteriaValues.CompareTo("10");

            //-------------Test Result ----------------------
            Assert.AreNotEqual(0, result);
        }
예제 #2
0
        public void Test_ConstructorRemovesQuotesAroundStrings()
        {
            //-------------Setup Test Pack ------------------
            object[] values = new object[] { "'100'", "'200'", "'300'" };
            Criteria.CriteriaValues criteriaValues = new Criteria.CriteriaValues(values);

            //-------------Execute test ---------------------
            int result = criteriaValues.CompareTo("100");

            //-------------Test Result ----------------------
            Assert.AreEqual(0, result);
        }
예제 #3
0
        public void Test_CompareTo_WhenInValues_ShouldReturnZero()
        {
            //-------------Setup Test Pack ------------------
            object[] values = new object[] { "100", "200", "300" };
            Criteria.CriteriaValues criteriaValues = new Criteria.CriteriaValues(values);

            //-------------Execute test ---------------------
            int result = criteriaValues.CompareTo("100");

            //-------------Test Result ----------------------
            Assert.AreEqual(0, result);
        }
예제 #4
0
        public void Test_CompareTo_WhenNullInValuesAndLookingForValue_ShouldReturnZero()
        {
            //-------------Setup Test Pack ------------------
            object[] values = new object[] { "100", null, "300" };
            Criteria.CriteriaValues criteriaValues = new Criteria.CriteriaValues(values);

            //-------------Execute test ---------------------
            int result = criteriaValues.CompareTo("300");

            //-------------Test Result ----------------------
            Assert.AreEqual(0, result);
        }
예제 #5
0
 public void Test_ConstructorRemovesQuotesAroundStrings()
 {
     //-------------Setup Test Pack ------------------
     object[] values = new object[] { "'100'", "'200'", "'300'" };
     Criteria.CriteriaValues criteriaValues = new Criteria.CriteriaValues(values);
     
     //-------------Execute test ---------------------
     int result = criteriaValues.CompareTo("100");
     //-------------Test Result ----------------------
     Assert.AreEqual(0, result);
 }