public void CheckPlainSection () { MeasurementService s = new MeasurementService(this.graphics); Rectangle r = new Rectangle(section.Location,section.Size); s.FitSectionToItems(this.section); Assert.AreEqual(r.Location,s.Rectangle.Location); }
public void ReportItemFitInSection () { MeasurementService s = new MeasurementService(this.graphics); Rectangle r = new Rectangle(section.Location,section.Size); this.section.Items.Clear(); BaseReportItem item = new BaseReportItem(); item.Location = new Point(10,10); item.Size = new Size(50,50); this.section.Items.Add(item); s.FitSectionToItems(this.section); Assert.AreEqual(r.Location,s.Rectangle.Location); }
private static Rectangle FindSurroundingRectangle_2(Graphics graphics, IEnumerable <BaseReportItem> canGrowShrinkCollection) { int top = int.MaxValue; Rectangle rec = new Rectangle(canGrowShrinkCollection.First().Location.X, canGrowShrinkCollection.First().Location.Y, canGrowShrinkCollection.First().Size.Width, canGrowShrinkCollection.First().Size.Height); foreach (BaseReportItem elemToLayout in canGrowShrinkCollection) { Size textSize = MeasurementService.MeasureReportItem(graphics, elemToLayout); elemToLayout.Size = new Size(elemToLayout.Size.Width, textSize.Height); rec = Rectangle.Union(rec, new Rectangle(elemToLayout.Location, elemToLayout.Size)); top = Math.Min(top, elemToLayout.Location.Y); } return(rec); }
public void Constructor() { MeasurementService s = new MeasurementService(this.graphics); Assert.IsNotNull(s); }