예제 #1
0
        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));
        }
예제 #2
0
        public void MakeSectionSegments_SectionsNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate test = () => SectionSegmentsHelper.MakeSectionSegments(null);

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(test);

            Assert.AreEqual("sections", exception.ParamName);
        }
예제 #3
0
        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);
        }