public void ShouldCreateIsNullWhereQuery() { var builder = new WhereBuilder<Model.Model>() .Where("Id", new IsNull<int>()) .ToString(); builder.Should().Be("WHERE [Id] IS NULL"); }
public void ShouldCreateGreaterThenWhereQuery() { var builder = new WhereBuilder<Model.Model>() .Where("Id", new GreaterThen<int>(1)) .ToString(); builder.Should().Be("WHERE [Id] > 1"); }
public void ShouldCreateEqualsWhereQuery() { var builder = new WhereBuilder<Model.Model>() .Where("Id", new Equals<int>(1)) .ToString(); builder.Should().Be("WHERE [Id] = 1"); }
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)"); }
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'"); }