public void Row_TwoLinesIntersectInvert() { var row = new Row(); row.AddLine(new Line(2, 4, 2)); row.AddLine(new Line(0, 3, 1)); PrintRowData(row); var lines = row.ToLines(); Assert.AreEqual(2, lines.Count); AreEqualLines(new Line(0, 3, 1), lines[0]); AreEqualLines(new Line(3, 4, 2), lines[1]); Assert.AreEqual(4, row.Width, "Row width not equal"); Assert.AreEqual(2, row.Center, "Row center not equal"); Assert.IsFalse(row.IsEmpty, "Row is empty"); Assert.AreEqual(1, row.GetValue(0), "Row(0) not equal"); Assert.AreEqual(1, row.GetValue(1), "Row(1) not equal"); Assert.AreEqual(1, row.GetValue(2), "Row(2) not equal"); Assert.AreEqual(2, row.GetValue(3), "Row(3) not equal"); Assert.AreEqual(Constants.AirMaterial, row.GetValue(4), "Row(4) not equal"); }
public void Converter_ToText_SimpleRow() { #region TestData var row = new Row(); row.AddLine(new Line(1, 3, 3)); #endregion var expected = @"ROW NR. 2 FIRST PIXEL: 2 NUMBER OF AREAS: 1 3 3"; var actual = row.ToText(2, false); Assert.AreEqual(expected, actual); }
public void Row_SimpleLine() { var row = new Row(); row.AddLine(new Line(0, 3, 1)); var lines = row.ToLines(); Assert.AreEqual(1, lines.Count, "Lines count not equal"); AreEqualLines(new Line(0, 3, 1), lines[0]); Assert.AreEqual(3, row.Width, "Row width not equal"); Assert.AreEqual(1, row.Center, "Row center not equal"); Assert.IsFalse(row.IsEmpty, "Row is empty"); Assert.AreEqual(1, row.GetValue(0), "Row(0) not equal"); Assert.AreEqual(1, row.GetValue(1), "Row(1) not equal"); Assert.AreEqual(1, row.GetValue(2), "Row(2) not equal"); Assert.AreEqual(Constants.AirMaterial, row.GetValue(3), "Row(3) not equal"); }