|
|
|
@ -105,7 +105,6 @@ namespace ICSharpCode.Reports.Core.Test.Printing
@@ -105,7 +105,6 @@ namespace ICSharpCode.Reports.Core.Test.Printing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void PageHeader_Location_One_Point_Under_ReportHeader() |
|
|
|
|
{ |
|
|
|
@ -113,7 +112,7 @@ namespace ICSharpCode.Reports.Core.Test.Printing
@@ -113,7 +112,7 @@ namespace ICSharpCode.Reports.Core.Test.Printing
|
|
|
|
|
BaseSection pageHeader = CreateSection(); |
|
|
|
|
Sut.MeasureReportHeader(reportHeader); |
|
|
|
|
Sut.MeasurePageHeader(pageHeader); |
|
|
|
|
Assert.That (pageHeader.SectionOffset,Is.GreaterThan(Sut.ReportHeaderRectangle.Bottom)); |
|
|
|
|
|
|
|
|
|
Assert.That (pageHeader.SectionOffset,Is.EqualTo(Sut.ReportHeaderRectangle.Bottom + 1)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -134,21 +133,26 @@ namespace ICSharpCode.Reports.Core.Test.Printing
@@ -134,21 +133,26 @@ namespace ICSharpCode.Reports.Core.Test.Printing
|
|
|
|
|
{ |
|
|
|
|
var setting = new ReportSettings(); |
|
|
|
|
SectionBounds sectionBounds = new SectionBounds(new ReportSettings(),true); |
|
|
|
|
BaseSection baseSection = new BaseSection(); |
|
|
|
|
baseSection.Location = new Point (50,50); |
|
|
|
|
baseSection.Size = new Size (727,60); |
|
|
|
|
sectionBounds.MeasurePageFooter(baseSection); |
|
|
|
|
//sectionBounds.MeasurePageFooter(Sut);
|
|
|
|
|
Assert.AreEqual(baseSection.Size.Height, |
|
|
|
|
sectionBounds.PageFooterRectangle.Size.Height); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.AreEqual(sectionBounds.MarginBounds.Width, |
|
|
|
|
sectionBounds.PageFooterRectangle.Width); |
|
|
|
|
//int i = sectionBounds.PageSize.Height - setting.BottomMargin;
|
|
|
|
|
//Assert.AreEqual(i,sectionBounds.PageFooterRectangle.Location.Y);
|
|
|
|
|
BaseSection pageFootter = CreateSection(); |
|
|
|
|
|
|
|
|
|
sectionBounds.MeasurePageFooter(pageFootter); |
|
|
|
|
Size expectedSize = pageFootter.Size; |
|
|
|
|
|
|
|
|
|
Assert.That(expectedSize,Is.EqualTo(sectionBounds.PageFooterRectangle.Size)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void PageFooter_From_PageEnd_Uppward() |
|
|
|
|
{ |
|
|
|
|
SectionBounds sectionBounds = new SectionBounds(new ReportSettings(),true); |
|
|
|
|
BaseSection pageFootter = CreateSection(); |
|
|
|
|
|
|
|
|
|
sectionBounds.MeasurePageFooter(pageFootter); |
|
|
|
|
int top = sectionBounds.MarginBounds.Bottom - pageFootter.Size.Height; |
|
|
|
|
|
|
|
|
|
Assert.That(sectionBounds.PageFooterRectangle.Top,Is.EqualTo(top)); |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region MeasureReportFooter
|
|
|
|
@ -160,64 +164,56 @@ namespace ICSharpCode.Reports.Core.Test.Printing
@@ -160,64 +164,56 @@ namespace ICSharpCode.Reports.Core.Test.Printing
|
|
|
|
|
Sut.MeasureReportFooter(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void MeasureReportFooterNoPageFooterCalculated() |
|
|
|
|
public void ReportFooter_No_PageFooter_Is_Calculated() |
|
|
|
|
{ |
|
|
|
|
SectionBounds sectionBounds = new SectionBounds(new ReportSettings(),true); |
|
|
|
|
BaseSection baseSection = new BaseSection(); |
|
|
|
|
baseSection.Location = new Point (50,50); |
|
|
|
|
baseSection.Size = new Size (727,60); |
|
|
|
|
sectionBounds.MeasureReportFooter(baseSection); |
|
|
|
|
Assert.AreEqual(baseSection.Size.Height ,sectionBounds.ReportFooterRectangle.Size.Height); |
|
|
|
|
|
|
|
|
|
Assert.AreEqual(sectionBounds.MarginBounds.Width, |
|
|
|
|
sectionBounds.ReportFooterRectangle.Width); |
|
|
|
|
BaseSection reportFootter = CreateSection(); |
|
|
|
|
sectionBounds.MeasureReportFooter(reportFootter); |
|
|
|
|
Size expectedSize = reportFootter.Size; |
|
|
|
|
Assert.That(sectionBounds.ReportFooterRectangle.Size,Is.EqualTo(expectedSize)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void MeasureReportFooterPageFooterIsCalculated() |
|
|
|
|
{ |
|
|
|
|
SectionBounds sectionBounds = new SectionBounds(new ReportSettings(),true); |
|
|
|
|
BaseSection baseSection = new BaseSection(); |
|
|
|
|
baseSection.Location = new Point (50,50); |
|
|
|
|
baseSection.Size = new Size (727,60); |
|
|
|
|
sectionBounds.MeasurePageFooter(baseSection); |
|
|
|
|
sectionBounds.MeasureReportFooter(baseSection); |
|
|
|
|
BaseSection pageFootter = CreateSection(); |
|
|
|
|
BaseSection reportFootter = CreateSection(); |
|
|
|
|
|
|
|
|
|
sectionBounds.MeasurePageFooter(pageFootter); |
|
|
|
|
sectionBounds.MeasureReportFooter(reportFootter); |
|
|
|
|
|
|
|
|
|
int top = sectionBounds.MarginBounds.Bottom - pageFootter.Size.Height - reportFootter.Size.Height -1; |
|
|
|
|
Assert.That(sectionBounds.ReportFooterRectangle.Top,Is.EqualTo(top)); |
|
|
|
|
|
|
|
|
|
Assert.AreEqual(baseSection.Size.Height , sectionBounds.ReportFooterRectangle.Size.Height, |
|
|
|
|
"ItemsCollection is empty, so Size.Height should be '0'"); |
|
|
|
|
Assert.AreEqual(sectionBounds.MarginBounds.Width, |
|
|
|
|
sectionBounds.ReportFooterRectangle.Width); |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void DetailStart () |
|
|
|
|
public void DetailStart_One_Below_PageHeader () |
|
|
|
|
{ |
|
|
|
|
/* |
|
|
|
|
|
|
|
|
|
SectionBounds sectionBounds = new SectionBounds(new ReportSettings(),true); |
|
|
|
|
BaseSection baseSection = new BaseSection(); |
|
|
|
|
baseSection.Location = new Point (50,50); |
|
|
|
|
baseSection.Size = new Size (727,60); |
|
|
|
|
sectionBounds.MeasurePageHeader(baseSection); |
|
|
|
|
Point p = new Point(sectionBounds.PageHeaderRectangle.Left,sectionBounds.PageHeaderRectangle.Bottom + sectionBounds.Gap ); |
|
|
|
|
Assert.AreEqual(p,sectionBounds.DetailStart); |
|
|
|
|
*/ |
|
|
|
|
BaseSection pageHeader = new BaseSection(); |
|
|
|
|
|
|
|
|
|
sectionBounds.MeasurePageHeader(pageHeader); |
|
|
|
|
Point p = new Point(sectionBounds.PageHeaderRectangle.Left,sectionBounds.PageHeaderRectangle.Bottom +1 ); |
|
|
|
|
Assert.That(sectionBounds.DetailStart,Is.EqualTo(p)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void DetailEnds () |
|
|
|
|
public void DetailEnds_One_Above_PageFootter () |
|
|
|
|
{ |
|
|
|
|
/* |
|
|
|
|
|
|
|
|
|
SectionBounds sectionBounds = new SectionBounds(new ReportSettings(),true); |
|
|
|
|
BaseSection baseSection = new BaseSection(); |
|
|
|
|
baseSection.Location = new Point (50,50); |
|
|
|
|
baseSection.Size = new Size (727,60); |
|
|
|
|
sectionBounds.MeasurePageFooter(baseSection); |
|
|
|
|
Point p = new Point(sectionBounds.PageFooterRectangle.Left,sectionBounds.PageFooterRectangle.Top - sectionBounds.Gap); |
|
|
|
|
Assert.AreEqual(p,sectionBounds.DetailEnds); |
|
|
|
|
*/ |
|
|
|
|
BaseSection pageFootter = CreateSection(); |
|
|
|
|
|
|
|
|
|
sectionBounds.MeasurePageFooter(pageFootter); |
|
|
|
|
Point p = new Point(sectionBounds.PageFooterRectangle.Left,sectionBounds.PageFooterRectangle.Top -1); |
|
|
|
|
Assert.That(sectionBounds.DetailEnds,Is.EqualTo(p)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void Setup() |
|
|
|
@ -231,12 +227,6 @@ namespace ICSharpCode.Reports.Core.Test.Printing
@@ -231,12 +227,6 @@ namespace ICSharpCode.Reports.Core.Test.Printing
|
|
|
|
|
var sec = new BaseSection(); |
|
|
|
|
sec.Location = new Point (50,50); |
|
|
|
|
sec.Size = new Size (727,60); |
|
|
|
|
/* |
|
|
|
|
sec.Items.Add (new BaseTextItem() |
|
|
|
|
{ |
|
|
|
|
Text = "mytext"; |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
return sec; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|