public void InformationBuilder003() { // Arrange var offsetParameterMock = new Mock <IOffsetParameter <TestDocument> >(); var limitParameterMock = new Mock <ILimitParameter <TestDocument> >(); offsetParameterMock.SetupGet(q => q.Value).Returns(0); limitParameterMock.SetupGet(q => q.Value).Returns(100); var list = new List <ISearchParameter> { offsetParameterMock.Object, limitParameterMock.Object }; // Act var statistic = InformationBuilder <TestDocument> .Create(list, 1, 0); // Assert Assert.Equal(0, statistic.DocumentCount); Assert.Equal(new TimeSpan(0, 0, 0, 0, 1), statistic.ElapsedTime); Assert.Equal(false, statistic.HasNextPage); Assert.Equal(false, statistic.HasPreviousPage); Assert.Equal(true, statistic.IsFirstPage); Assert.Equal(true, statistic.IsLastPage); Assert.Equal(0, statistic.PageCount); Assert.Equal(1, statistic.PageNumber); Assert.Equal(100, statistic.PageSize); }
//================================ // Override Methods //================================ public override void AppendInformation(InformationBuilder builder) { base.AppendInformation(builder); builder.AppendIndentedLine("FilePath=" + this.Path); foreach (var p in this.ReplaceCommands) { builder.AppendIndentedLine("To=" + p.Key + ", Value= " + p.Value); } }
protected void AppendChildInformation(InformationBuilder builder) { if (!this.IsEntity) { var childBuilder = builder.CreateChild(); foreach (var c in this.ChildContents) { childBuilder.Append(c); } } }
//================================ // Override Methods //================================ public override string ToString() { var builder = new InformationBuilder(); builder.AppendLine("[Sources]"); foreach (var s in this.SourceTable) { builder.Append(s); } builder.AppendLine("[Moduleds]"); foreach (var m in this.ModuleTable) { builder.Append(m); } builder.AppendLine("[Documents]"); foreach (var d in this.DocumentTable) { builder.Append(d); } return(builder.ToString()); }
//================================ // Override Methods //================================ public override void AppendInformation(InformationBuilder builder) { base.AppendInformation(builder); builder.AppendIndentedLine("FilePath=" + this.Path); }
protected void AppendMyInformation(InformationBuilder builder) { builder.AppendLine("*" + this.GetType().Name + "(" + this.Id + ") Index=" + this.Index.ToString()); builder.AppendIndentedLine("Label=" + this.Label); builder.AppendIndentedLine("Name=" + this.Name); }
public virtual void AppendInformation(InformationBuilder builder) { this.AppendMyInformation(builder); this.AppendChildInformation(builder); }
public virtual void AppendInformation(InformationBuilder builder) { builder.AppendLine("*" + this.GetType().Name + "(" + this.Id + ")"); builder.AppendIndentedLine("Name=" + this.Name); }
//================================ // Override Methods //================================ public override void AppendInformation(InformationBuilder builder) { base.AppendInformation(builder); builder.AppendIndentedLine("Url=" + this.Url); builder.AppendIndentedLine("TemplateId=" + this.TemplateId); }