Beispiel #1
0
        public void ColumnNameAndStringContains()
        {
            using (var context = new TestContext())
            {
                var filter = new VartotojaiFilter()
                {
                    NameContains = "2",
                };

                var vartotojai = context.Vartotojai.Filter(filter).ToArray();

                Assert.IsNotNull(vartotojai, "Vartotojai nerasti");
                Assert.AreEqual("n2", vartotojai.First().Name);
                Assert.IsFalse(vartotojai.Any(v => v.Name != "n2"));
            }
        }
Beispiel #2
0
        public void FilterByName()
        {
            using (var context = new TestContext())
            {
                var filter = new VartotojaiFilter()
                {
                    Name = "n2"
                };

                var vartotojai = context.Vartotojai.Filter(filter).ToArray();

                Assert.IsNotNull(vartotojai, "Vartotojai nerasti");
                Assert.AreEqual("n2", vartotojai.First().Name);
                Assert.IsFalse(vartotojai.Any(v => v.Name == "n1"));
                Assert.IsFalse(vartotojai.Any(v => v.Name == "n3"));
            }
        }
Beispiel #3
0
        public void IdIsGreaterOrEqual()
        {
            using (var context = new TestContext())
            {
                var filter = new VartotojaiFilter()
                {
                    Name = "n3",
                    Id   = 6
                };

                var vartotojai = context.Vartotojai.Filter(filter).ToArray();

                Assert.IsNotNull(vartotojai, "Vartotojai nerasti");
                Assert.AreEqual("n3", vartotojai.First().Name);
                Assert.IsTrue(vartotojai.All(v => v.Id >= 6));
            }
        }
Beispiel #4
0
        public void ArrayContains()
        {
            using (var context = new TestContext())
            {
                var filter = new VartotojaiFilter()
                {
                    NameIn         = new string[] { "n1", "n3" },
                    OrderColumn    = "Name",
                    OrderDirection = Direction.Desc
                };

                var vartotojai = context.Vartotojai.Filter(filter).ToArray();

                Assert.IsNotNull(vartotojai, "Vartotojai nerasti");
                Assert.AreEqual("n3", vartotojai.First().Name);
                Assert.AreEqual("n1", vartotojai.Last().Name);
                Assert.IsFalse(vartotojai.Any(v => v.Name == "n2"));
            }
        }