diff --git a/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs b/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs index 070938d..7f94986 100644 --- a/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs +++ b/src/CamlGen.Tests/Elements/Value/RowLimitTests.cs @@ -27,10 +27,28 @@ public class RowLimitTests : TestBase public void RowLimitWitANumberPrintsTheRowLimit() { var limit = Fixture.Create(); - var sut = new RowLimit(limit); + var sut = new RowLimit(limit, null); sut.ToString().ShouldBe(string.Format("{0}", limit)); } + + [Fact] + public void RowLimitPagedWitANumberPrintsTheRowLimit() + { + var limit = Fixture.Create(); + var sut = new RowLimit(limit, true); + + sut.ToString().ShouldBe(string.Format("{0}", limit)); + } + + [Fact] + public void RowLimitNotPagedWitANumberPrintsTheRowLimit() + { + var limit = Fixture.Create(); + var sut = new RowLimit(limit, false); + + sut.ToString().ShouldBe(string.Format("{0}", limit)); + } [Fact] public void AViewCanSetARowLimit() diff --git a/src/CamlGen/Elements/Core/View.cs b/src/CamlGen/Elements/Core/View.cs index 247be64..eee3cc0 100644 --- a/src/CamlGen/Elements/Core/View.cs +++ b/src/CamlGen/Elements/Core/View.cs @@ -100,10 +100,10 @@ public View QueryOptions(Action action) /// Add a RowLimit to this View /// /// - /// - public View RowLimit(int rowLimit) + /// Fluent + public View RowLimit(int rowLimit, bool? paged = null) { - var child = new RowLimit(rowLimit); + var child = new RowLimit(rowLimit, paged); Childs.Add(child); return this; } diff --git a/src/CamlGen/Elements/Value/RowLimit.cs b/src/CamlGen/Elements/Value/RowLimit.cs index f198c1d..7931dbb 100644 --- a/src/CamlGen/Elements/Value/RowLimit.cs +++ b/src/CamlGen/Elements/Value/RowLimit.cs @@ -10,15 +10,21 @@ All other rights reserved. WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. ***/ +using System; using System.Globalization; namespace FluentCamlGen.CamlGen.Elements.Value { internal class RowLimit : BaseValueElement { - internal RowLimit(int rowLimit) + internal RowLimit(int rowLimit, bool? paged) : base("RowLimit", rowLimit.ToString(CultureInfo.InvariantCulture)) { + if (paged.HasValue) + { + var val = paged.Value ? "TRUE" : "FALSE"; + Attributes.Add(new Tuple("Paged", val)); + } } } } \ No newline at end of file