Пример #1
0
        /// <summary>
        /// Gets the search filter instance.
        /// </summary>
        /// <param name="localName">Name of the local.</param>
        /// <returns></returns>
        private static SearchFilter GetSearchFilterInstance(string localName)
        {
            SearchFilter searchFilter;

            switch (localName)
            {
            case XmlElementNames.Exists:
                searchFilter = new Exists();
                break;

            case XmlElementNames.Contains:
                searchFilter = new ContainsSubstring();
                break;

            case XmlElementNames.Excludes:
                searchFilter = new ExcludesBitmask();
                break;

            case XmlElementNames.Not:
                searchFilter = new Not();
                break;

            case XmlElementNames.And:
                searchFilter = new SearchFilterCollection(LogicalOperator.And);
                break;

            case XmlElementNames.Or:
                searchFilter = new SearchFilterCollection(LogicalOperator.Or);
                break;

            case XmlElementNames.IsEqualTo:
                searchFilter = new IsEqualTo();
                break;

            case XmlElementNames.IsNotEqualTo:
                searchFilter = new IsNotEqualTo();
                break;

            case XmlElementNames.IsGreaterThan:
                searchFilter = new IsGreaterThan();
                break;

            case XmlElementNames.IsGreaterThanOrEqualTo:
                searchFilter = new IsGreaterThanOrEqualTo();
                break;

            case XmlElementNames.IsLessThan:
                searchFilter = new IsLessThan();
                break;

            case XmlElementNames.IsLessThanOrEqualTo:
                searchFilter = new IsLessThanOrEqualTo();
                break;

            default:
                searchFilter = null;
                break;
            }
            return(searchFilter);
        }
Пример #2
0
 public void IsNotEqualTo_String_False()
 {
     IsNotEqualTo.Value("hello").Evaluate("hello").Should().BeFalse();
 }
Пример #3
0
 public void IsNotEqualTo_String_True()
 {
     IsNotEqualTo.Value("hello").Evaluate("goodbye").Should().BeTrue();
 }
Пример #4
0
 public void IsNotEqualTo_Int_False()
 {
     IsNotEqualTo.Value(1).Evaluate(1).Should().BeFalse();
 }
Пример #5
0
 public void IsNotEqualTo_Int_True()
 {
     IsNotEqualTo.Value(1).Evaluate(2).Should().BeTrue();
 }
 /// <summary>
 /// Gets the search filter instance.
 /// </summary>
 /// <param name="localName">Name of the local.</param>
 /// <returns></returns>
 private static SearchFilter GetSearchFilterInstance(string localName)
 {
     SearchFilter searchFilter;
     switch (localName)
     {
         case XmlElementNames.Exists:
             searchFilter = new Exists();
             break;
         case XmlElementNames.Contains:
             searchFilter = new ContainsSubstring();
             break;
         case XmlElementNames.Excludes:
             searchFilter = new ExcludesBitmask();
             break;
         case XmlElementNames.Not:
             searchFilter = new Not();
             break;
         case XmlElementNames.And:
             searchFilter = new SearchFilterCollection(LogicalOperator.And);
             break;
         case XmlElementNames.Or:
             searchFilter = new SearchFilterCollection(LogicalOperator.Or);
             break;
         case XmlElementNames.IsEqualTo:
             searchFilter = new IsEqualTo();
             break;
         case XmlElementNames.IsNotEqualTo:
             searchFilter = new IsNotEqualTo();
             break;
         case XmlElementNames.IsGreaterThan:
             searchFilter = new IsGreaterThan();
             break;
         case XmlElementNames.IsGreaterThanOrEqualTo:
             searchFilter = new IsGreaterThanOrEqualTo();
             break;
         case XmlElementNames.IsLessThan:
             searchFilter = new IsLessThan();
             break;
         case XmlElementNames.IsLessThanOrEqualTo:
             searchFilter = new IsLessThanOrEqualTo();
             break;
         default:
             searchFilter = null;
             break;
     }
     return searchFilter;
 }