コード例 #1
0
            public void TestMethod_Eq()
            {
                var expected = "A = 5 AND B = 10 AND C = 7";
                var actual   = DbHelper.GetWhereString(SqlFilter.Eq("A", 5), SqlFilter.Eq("B", 10), SqlFilter.Eq("C", 7));

                Assert.AreEqual(expected, actual);
            }
コード例 #2
0
            public void SqlFilterTests_Or()
            {
                var expected = "A=5 OR B=6 OR C=3";
                var actual   =
                    DbHelper.GetWhereString(SqlFilter.Eq("A", 5).Or(SqlFilter.Eq("B", 6)).Or(SqlFilter.Eq("C", 3)));

                Assert.AreEqual(expected, actual);
                ;
            }
コード例 #3
0
            public void ChannelsDataContextTests_GetList()
            {
                var items = ChannelDataContext.Instance.GetList(2, SqlFilter.Eq("Name", "Ivan"));

                Assert.AreNotEqual(0, items.Count);
            }
コード例 #4
0
        public void ChannelDataContextTests_GetList()
        {
            var items = ChannelDataContext.Instance.GetList(1, SqlFilter.Eq("Name", "Pervyy"), SqlFilter.IsNull("UpdatedUtc").Or(SqlFilter.Lt("UpdatedUtc", DateTime.UtcNow.AddHours(-4))));

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