public void MakeSectionSegments_ValidFailureMechanismSections_ReturnSectionSegmentsFromFailureMechanismSection() { // Setup FailureMechanismSection[] failureMechanismSections = { new FailureMechanismSection(string.Empty, new[] { new Point2D(0, 0) }), new FailureMechanismSection(string.Empty, new[] { new Point2D(1, 1) }), new FailureMechanismSection(string.Empty, new[] { new Point2D(2, 2) }), new FailureMechanismSection(string.Empty, new[] { new Point2D(3, 3) }) }; // Call SectionSegments[] segmentSections = SectionSegmentsHelper.MakeSectionSegments(failureMechanismSections); // Assert Assert.AreEqual(failureMechanismSections.Length, segmentSections.Length); CollectionAssert.AreEqual(failureMechanismSections, segmentSections.Select(ss => ss.Section)); }
public void MakeSectionSegments_SectionsNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => SectionSegmentsHelper.MakeSectionSegments(null); // Assert var exception = Assert.Throws <ArgumentNullException>(test); Assert.AreEqual("sections", exception.ParamName); }
public void MakeSectionSegments_SectionsElementNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => SectionSegmentsHelper.MakeSectionSegments(new FailureMechanismSection[] { null }); // Assert var exception = Assert.Throws <ArgumentNullException>(test); Assert.AreEqual("section", exception.ParamName); }