Esempio n. 1
0
        public void ShouldCreateIsNullWhereQuery()
        {
            var builder =
                new WhereBuilder<Model.Model>()
                    .Where("Id", new IsNull<int>())
                    .ToString();

            builder.Should().Be("WHERE [Id] IS NULL");
        }
Esempio n. 2
0
        public void ShouldCreateGreaterThenWhereQuery()
        {
            var builder =
                new WhereBuilder<Model.Model>()
                    .Where("Id", new GreaterThen<int>(1))
                    .ToString();

            builder.Should().Be("WHERE [Id] > 1");
        }
Esempio n. 3
0
        public void ShouldCreateEqualsWhereQuery()
        {
            var builder =
                new WhereBuilder<Model.Model>()
                    .Where("Id", new Equals<int>(1))
                    .ToString();

            builder.Should().Be("WHERE [Id] = 1");
        }
Esempio n. 4
0
        public void ShouldCreateAndWhereQuery()
        {
            var builder =
                new WhereBuilder<Model.Model>()
                    .Where("Id", new IsNotNull<int>())
                    .AndWhere("Id", new IsNull<int>())
                    .ToString();

            builder.Should().Be("WHERE ([Id] IS NOT NULL AND [Id] IS NULL)");
        }
Esempio n. 5
0
        public void ShouldCreateLikeWhereQuery()
        {
            var builder =
                new WhereBuilder<Model.Model>()
                    .Where(model => model.Name, new Like<string>("%JONY"))
                    .ToString();

            builder.Should().Be("WHERE [Name] LIKE '%JONY'");
        }