public void TestConstructor() { //---------------Set up test pack------------------- string propertyName = TestUtil.GetRandomString(); const FilterClauseOperator filterClauseOperator = FilterClauseOperator.OpGreaterThan; //---------------Execute Test ---------------------- StringTextBoxFilter filter = new StringTextBoxFilter(GetControlFactory(), propertyName, filterClauseOperator); //---------------Test Result ----------------------- Assert.IsInstanceOf(typeof(ITextBox), filter.Control); Assert.AreEqual(propertyName, filter.PropertyName); Assert.AreEqual(filterClauseOperator, filter.FilterClauseOperator); Assert.IsInstanceOf(typeof(DataViewNullFilterClause), filter.GetFilterClause(new DataViewFilterClauseFactory())); }
public void TestConstructor() { //---------------Set up test pack------------------- string propertyName = TestUtil.GetRandomString(); const FilterClauseOperator filterClauseOperator = FilterClauseOperator.OpGreaterThan; //---------------Execute Test ---------------------- StringTextBoxFilter filter = new StringTextBoxFilter(GetControlFactory(), propertyName, filterClauseOperator); //---------------Test Result ----------------------- Assert.IsInstanceOf(typeof(ITextBox), filter.Control); Assert.AreEqual(propertyName, filter.PropertyName); Assert.AreEqual(filterClauseOperator, filter.FilterClauseOperator); Assert.IsInstanceOf(typeof(DataViewNullFilterClause), filter.GetFilterClause(new DataViewFilterClauseFactory())); }
public void TestFilterClause() { //---------------Set up test pack------------------- string propertyName = TestUtil.GetRandomString(); const FilterClauseOperator filterClauseOperator = FilterClauseOperator.OpGreaterThan; StringTextBoxFilter filter = new StringTextBoxFilter(GetControlFactory(), propertyName, filterClauseOperator); ITextBox textBox = (ITextBox) filter.Control; string text = TestUtil.GetRandomString(); textBox.Text = text; //---------------Execute Test ---------------------- IFilterClause filterClause = filter.GetFilterClause(new DataViewFilterClauseFactory()); //---------------Test Result ----------------------- Assert.AreEqual(string.Format("{0} > '{1}'", propertyName, text), filterClause.GetFilterClauseString()); //---------------Tear Down ------------------------- }
public void TestFilterClause() { //---------------Set up test pack------------------- string propertyName = TestUtil.GetRandomString(); const FilterClauseOperator filterClauseOperator = FilterClauseOperator.OpGreaterThan; StringTextBoxFilter filter = new StringTextBoxFilter(GetControlFactory(), propertyName, filterClauseOperator); ITextBox textBox = (ITextBox)filter.Control; string text = TestUtil.GetRandomString(); textBox.Text = text; //---------------Execute Test ---------------------- IFilterClause filterClause = filter.GetFilterClause(new DataViewFilterClauseFactory()); //---------------Test Result ----------------------- Assert.AreEqual(string.Format("{0} > '{1}'", propertyName, text), filterClause.GetFilterClauseString()); //---------------Tear Down ------------------------- }