public void AddCustomSearchCriterion_PassNotSupportedLambdaExpression_ArgumentExceptionThrown() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); Assert.Throws <ArgumentException>( () => criteria.AddCustomSearchCriterion <SomeClass>(o => o.CollectionComplex.Select(i => i.Nested).Select(i => i.TextNested))); }
public void AddCustomSearchCriterion_PassNotSupportedProperty_CorrectCriterionReturned() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); criteria.AddCustomSearchCriterion <SomeClass>(o => o.CollectionComplex); Assert.Equal(0, criteria.Count); }
public void AddCustomSearchCriterion_PassPropertyLambdaExpression_CorrectCriterionAdded() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); criteria.AddCustomSearchCriterion <SomeClass>(o => o.Text); Assert.Equal(1, criteria.Count); Assert.Equal("Text", criteria.ElementAt(0).Property); }
public void AddCustomSearchCriterion_PassNestedPropertyInSimpleCollectionLambdaExpression_CorrectCriterionAdded() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); criteria.AddCustomSearchCriterion <SomeClass>(o => o.CollectionString); Assert.Equal(1, criteria.Count); Assert.Equal("CollectionString", criteria.ElementAt(0).Property); }
public void AddCustomSearchCriterion_PassNestedPropertyInComplexCollectionLambdaExpression_CorrectCriterionAdded() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); criteria.AddCustomSearchCriterion <SomeClass>(o => o.CollectionComplex.Select(i => i.TextNested)); Assert.Equal(1, criteria.Count); Assert.Equal("CollectionComplex.TextNested", criteria.ElementAt(0).Property); Assert.Equal("TextNested with label", criteria.ElementAt(0).LabelText); }
public void AddCustomSearchCriterion_PassNotSupportedLambdaExpression_CorrectCriterionReturned() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); Assert.Throws <ArgumentException>(() => criteria.AddCustomSearchCriterion <SomeClass>(o => o)); }
public void AddCustomSearchCriterion_PassNotSupportedLambdaExpression_CorrectCriterionReturned() { ICollection <AbstractSearch> criteria = new Collection <AbstractSearch>(); criteria.AddCustomSearchCriterion <SomeClass>(o => o); }