public void Extend_ExceptionOnDiscontinuity() { // Arrange var curve1 = new FillCurve <FillSegment>(new Vector2d[] { new Vector2d(0, 0), new Vector2d(1, 0), }); var curve2 = new FillCurve <FillSegment>(new Vector2d[] { new Vector2d(2, 0), new Vector2d(3, 0), }); // Act & Assert Assert.ThrowsException <ArgumentException>(() => { curve1.Extend(curve2.Elements); }); }
public void Extend_Success() { // Arrange var curve1 = new FillCurve <FillSegment>(new Vector2d[] { new Vector2d(0, 0), new Vector2d(1, 0), }); var curve2 = new FillCurve <FillSegment>(new Vector2d[] { new Vector2d(1, 0), new Vector2d(2, 1), new Vector2d(3, 3), }); // Act curve1.Extend(curve2.Elements); // Assert Assert.AreEqual(3, curve1.Elements.Count); Assert.AreEqual(new Vector2d(0, 0), curve1.Entry); Assert.AreEqual(curve2.Exit, curve1.Exit); }