Example #1
0
 ///<summary>
 ///Serves as a hash function for a particular type.
 ///</summary>
 ///
 ///<returns>
 ///A hash code for the current <see cref="T:System.Object" />.
 ///</returns>
 ///<filterpriority>2</filterpriority>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = (_list != null ? _list.GetHashCode() : 0);
         result = (result * 397) ^ (SortColumn != null ? SortColumn.GetHashCode() : 0);
         result = (result * 397) ^ (FilterDef != null ? FilterDef.GetHashCode() : 0);
         return(result);
     }
 }
Example #2
0
 public void Test_Constructor_WithNoParameters()
 {
     //---------------Set up test pack-------------------
     //---------------Assert PreConditions---------------            
     //---------------Execute Test ----------------------
     FilterDef filterDef = new FilterDef();
     //---------------Test Result -----------------------
     Assert.IsNotNull(filterDef.FilterPropertyDefs);
     Assert.AreEqual(FilterModes.Filter, filterDef.FilterMode);    
 }
Example #3
0
 public void Test_Constructor_WithListParameter()
 {
     //---------------Set up test pack-------------------
     IList<IFilterPropertyDef> filterPropertyDefs = MockRepository.GenerateStub < IList < IFilterPropertyDef >>();
     //---------------Assert PreConditions---------------            
     //---------------Execute Test ----------------------
     FilterDef filterDef = new FilterDef(filterPropertyDefs);
     //---------------Test Result -----------------------
     Assert.AreSame(filterPropertyDefs,filterDef.FilterPropertyDefs);
     Assert.AreEqual(FilterModes.Filter, filterDef.FilterMode);   
 }
 /// <summary>
 /// Creates an <see cref="IFilterControl"/> using the <see cref="IControlFactory"/> and creates all the filter controls
 /// defined by the <see cref="FilterDef"/> given.
 /// </summary>
 /// <param name="filterDef">The <see cref="FilterDef"/> to use in creation.</param>
 /// <returns>The created <see cref="IFilterControl"/></returns>
 public IFilterControl BuildFilterControl(FilterDef filterDef)
 {
     IFilterControl filterControl = _controlFactory.CreateFilterControl();
     BuildFilterControl(filterDef, filterControl);
     return filterControl;
 }