public void TestGetWhereExpression_IsNotNullCheck_NullablePropertyHasValue() { var list = new List <NullFilterTestClass>(); var instance = new NullFilterTestClass { S = "hello" }; list.Add(instance); var filter = new NullFilter <NullFilterTestClass>("S", true); var where = filter.ToWhereExpression(); var results = list.Where(where.Compile()).ToList(); Assert.AreEqual(1, results.Count); }
public void TestGetWhereExpression_DefaultIsNullCheck_NullablePropertyIsNull() { var list = new List <NullFilterTestClass>(); var instance = new NullFilterTestClass { S = null }; list.Add(instance); var filter = new NullFilter <NullFilterTestClass>("S"); var where = filter.ToWhereExpression(); var results = list.Where(where.Compile()).ToList(); Assert.AreEqual(1, results.Count); }