public void TestNotEqualFilter_NonNullableInteger_NotEqualValue()
        {
            var instance = new EqualFilterTestClass
            {
                Int = 1
            };
            var list = new List <EqualFilterTestClass>();

            list.Add(instance);

            var filter = new NotEqualFilter <EqualFilterTestClass>("Int", 0);

            var where = filter.ToWhereExpression();
            var results = list.Where(where.Compile()).ToList();

            Assert.AreEqual(1, results.Count);
        }
        public void TestEqualFilter_NullableDate_NotEqualValue()
        {
            var instance = new EqualFilterTestClass
            {
                NullableDate = DateTime.UtcNow
            };
            var list = new List <EqualFilterTestClass>();

            list.Add(instance);

            var filter = new NotEqualFilter <EqualFilterTestClass>("NullableDate", instance.NullableDate.Value.AddDays(1.0));

            var where = filter.ToWhereExpression();
            var results = list.Where(where.Compile()).ToList();

            Assert.AreEqual(1, results.Count);
        }
        public void TestNotEqualFilter_String_NotEqualValue()
        {
            var instance = new EqualFilterTestClass
            {
                S = "string"
            };
            var list = new List <EqualFilterTestClass>();

            list.Add(instance);

            var filter = new NotEqualFilter <EqualFilterTestClass>("S", "abc");

            var where = filter.ToWhereExpression();
            var results = list.Where(where.Compile()).ToList();

            Assert.AreEqual(1, results.Count);
        }
        public void TestToWhereExpression_DifferentNumericTypes()
        {
            var instance = new EqualFilterTestClass
            {
                Int = 1
            };
            var list = new List <EqualFilterTestClass>();

            list.Add(instance);

            var filter = new NotEqualFilter <EqualFilterTestClass>("Int", 1L);

            var where = filter.ToWhereExpression();
            var results = list.Where(where.Compile()).ToList();

            Assert.AreEqual(0, results.Count);
        }