public void CopyProperties_LineWithUpdatedGeometryAndReferenceLineIntersectionAndCharacteristicPoints_PropertiesUpdated() { // Setup var surfaceLine = new PipingSurfaceLine(string.Empty); PipingSurfaceLine surfaceLineToUpdateFrom = CreateSurfaceLineWithCharacteristicPoints(); // Call surfaceLine.CopyProperties(surfaceLineToUpdateFrom); // Assert AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); }
public void CopyProperties_WithSurfaceLineNull_ThrowsArgumentNullException() { // Setup var surfaceLine = new PipingSurfaceLine(string.Empty); // Call void Call() => surfaceLine.CopyProperties(null); // Assert var exception = Assert.Throws <ArgumentNullException>(Call); Assert.AreEqual("fromSurfaceLine", exception.ParamName); }
public void CopyProperties_LineWithUpdatedReferenceLineWorldPoint_PropertiesUpdated() { // Setup PipingSurfaceLine surfaceLine = CreateSurfaceLineWithCharacteristicPoints(); var expectedIntersectionPoint = new Point2D(123, 456); PipingSurfaceLine surfaceLineToUpdateFrom = CreateSurfaceLineWithCharacteristicPoints(); surfaceLineToUpdateFrom.ReferenceLineIntersectionWorldPoint = expectedIntersectionPoint; // Call surfaceLine.CopyProperties(surfaceLineToUpdateFrom); // Assert AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); }
public void CopyProperties_LineUpdatedWithRemovedCharacteristicPoints_PropertiesUpdated() { // Setup PipingSurfaceLine surfaceLine = CreateSurfaceLineWithCharacteristicPoints(); var surfaceLineToUpdateFrom = new PipingSurfaceLine(surfaceLine.Name) { ReferenceLineIntersectionWorldPoint = surfaceLine.ReferenceLineIntersectionWorldPoint }; surfaceLineToUpdateFrom.SetGeometry(surfaceLine.Points); // Call surfaceLine.CopyProperties(surfaceLineToUpdateFrom); // Assert AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); }
public void CopyProperties_LineWithUpdatedGeometricPoints_PropertiesUpdated() { // Setup PipingSurfaceLine surfaceLine = CreateSurfaceLineWithCharacteristicPoints(); PipingSurfaceLine surfaceLineToUpdateFrom = CreateSurfaceLineWithCharacteristicPoints(); var expectedGeometry = new List <Point3D> { new Point3D(0, 1, 2), new Point3D(3, 4, 5), new Point3D(6, 7, 8) }; expectedGeometry.AddRange(surfaceLine.Points); surfaceLineToUpdateFrom.SetGeometry(expectedGeometry); // Call surfaceLine.CopyProperties(surfaceLineToUpdateFrom); // Assert AssertPropertiesUpdated(surfaceLineToUpdateFrom, surfaceLine); }