Пример #1
0
 public void Test1([DataSources] string context)
 {
     using (var db = GetDataContext(context))
     {
         AreEqual(FixData,
                  Types2.Where(_ => _.BigIntValue != 2),
                  db.Types2.Where(_ => _.BigIntValue != 2));
     }
 }
Пример #2
0
 public void Test3([DataSources] string context)
 {
     using (var db = GetDataContext(context))
     {
         AreEqual(FixData,
                  Types2.Where(_ => (_.BoolValue ?? false) != true),
                  db.Types2.Where(_ => _.BoolValue != true));
     }
 }
Пример #3
0
 public void Test2(string context)
 {
     using (var db = GetDataContext(context))
     {
         AreEqual(FixData,
                  Types2.Where(_ => !_.BoolValue.Value),
                  db.Types2.Where(_ => !_.BoolValue.Value));
     }
 }
Пример #4
0
        public void Test4WithoutComparasionNullCheck([DataSources] string context)
        {
            using var _  = new CompareNullsAsValuesOption(false);
            using var db = GetDataContext(context);
            var bigintFilter = new long?[] { 2 };

            AreEqual(FixData,
                     Types2.Where(_ => !bigintFilter.Contains(_.BigIntValue) && _.BigIntValue != null),
                     db.Types2.Where(_ => !bigintFilter.Contains(_.BigIntValue)));
        }
Пример #5
0
        public void Test92([DataSources] string context)
        {
            using (var db = GetDataContext(context))
            {
                var boolFilter = new bool? [] { true };

                AreEqual(FixData,
                         Types2.Where(_ => boolFilter.Contains(_.BoolValue) == true),
                         db.Types2.Where(_ => boolFilter.Contains(_.BoolValue) == true));
            }
        }
Пример #6
0
        public void Test82([DataSources] string context)
        {
            using (var db = GetDataContext(context))
            {
                var bigintFilter = new long?[] { 2 };

                AreEqual(FixData,
                         Types2.Where(_ => bigintFilter.Contains(_.BigIntValue) == true),
                         db.Types2.Where(_ => bigintFilter.Contains(_.BigIntValue) == true));
            }
        }
Пример #7
0
        public void Test81(string context)
        {
            using (var db = GetDataContext(context))
            {
                var bigintFilter = new Int64?[] { 2 };

                AreEqual(FixData,
                         Types2.Where(_ => bigintFilter.Contains(_.BigIntValue)),
                         db.Types2.Where(_ => bigintFilter.Contains(_.BigIntValue)));
            }
        }
Пример #8
0
        public void Test4WithoutComparasionNullCheck([DataSources] string context)
        {
            using (new WithoutComparisonNullCheck())
                using (var db = GetDataContext(context))
                {
                    var bigintFilter = new long?[] { 2 };

                    AreEqual(FixData,
                             Types2.Where(_ => !bigintFilter.Contains(_.BigIntValue) && _.BigIntValue != null),
                             db.Types2.Where(_ => !bigintFilter.Contains(_.BigIntValue)));
                }
        }
Пример #9
0
        public void CompareDate2([IncludeDataSources(TestProvNameDb2i.All)] string context)
        {
            var dt = Types2[3].DateTimeValue;

            using (var db = GetDataContext(context))
            {
                var expected = Types2.Where(t => t.DateTimeValue.Value.Date > dt.Value.Date);
                var actual   = db.Types2.Where(t => t.DateTimeValue.Value.Date > dt.Value.Date);

                AreEqual(expected, actual);
            }
        }
Пример #10
0
 public void WhereDateTimeTest6(string context)
 {
     using (var db = GetDataContext(context))
     {
         AreEqual(
             AdjustExpectedData(db, Types2
                                .Where(_ => _.DateTimeValue.Value.Date == new DateTime(2009, 9, 20).Date)
                                .Select(_ => _)),
             db.Types2
             .Where(_ => _.DateTimeValue.Value.Date == new DateTime(2009, 9, 20).Date)
             .Select(_ => _));
     }
 }
Пример #11
0
 public void WhereDateTimeTest4(string context)
 {
     using (var db = GetDataContext(context))
     {
         AreEqual(
             Types2
             .Where(_ => _.DateTimeValue == new DateTime(2009, 9, 27))
             .Select(_ => _),
             db.Types2
             .Where(_ => _.DateTimeValue == new DateTime(2009, 9, 27))
             .Select(_ => _));
     }
 }
Пример #12
0
 public void WhereDateTimeTest4(string context)
 {
     using (var db = GetDataContext(context))
     {
         AreEqual(
                Types2
                 .Where(x => x.DateTimeValue == new DateTime(2009, 9, 27, 09, 19, 29).AddMilliseconds(90))
                 .Select(x => x),
             db.Types2
                 .Where(x => x.DateTimeValue == new DateTime(2009, 9, 27, 09, 19, 29).AddMilliseconds(90))
                 .Select(x => x));
     }
 }