public void Constructor_WithFailureMechanismSection_ExpectedValues() { // Setup var failureMechanismSection = new FailureMechanismSection(string.Empty, new[] { new Point2D(0, 0), new Point2D(1, 1), new Point2D(2, 2) }); // Call var sectionSegments = new SectionSegments(failureMechanismSection); // Assert Assert.AreEqual(failureMechanismSection, sectionSegments.Section); }
public void Distance_ValidDistances_ReturnsDistanceToGivenPoint(Point2D point, double expectedDistance) { // Setup var failureMechanismSection = new FailureMechanismSection(string.Empty, new[] { new Point2D(0, 0), new Point2D(1, 1), new Point2D(2, 2) }); var sectionSegments = new SectionSegments(failureMechanismSection); // Call double distance = sectionSegments.Distance(point); // Assert Assert.AreEqual(expectedDistance, distance); }
public void Distance_PointIsNull_ReturnsDistanceToGivenPoint() { // Setup var failureMechanismSection = new FailureMechanismSection(string.Empty, new[] { new Point2D(0, 0), new Point2D(1, 1), new Point2D(2, 2) }); var sectionSegments = new SectionSegments(failureMechanismSection); // Call TestDelegate test = () => sectionSegments.Distance(null); // Assert string paramName = Assert.Throws <ArgumentNullException>(test).ParamName; Assert.AreEqual("point", paramName); }