Example #1
0
 /// <summary>
 /// Asserts whether <paramref name="actual"/> is equal to <paramref name="expected"/>.
 /// </summary>
 /// <param name="expected">The expected <see cref="SlipPlaneConstraints"/>.</param>
 /// <param name="actual">The actual <see cref="SlipPlaneConstraints"/>.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="actual"/>
 /// is not equal to <paramref name="expected"/>.</exception>
 public static void AssertSlipPlaneConstraints(SlipPlaneConstraints expected, SlipPlaneConstraints actual)
 {
     Assert.AreEqual(expected.SlipPlaneMinDepth, actual.SlipPlaneMinDepth);
     Assert.AreEqual(expected.SlipPlaneMinLength, actual.SlipPlaneMinLength);
     Assert.AreEqual(expected.XEntryMin, actual.XEntryMin);
     Assert.AreEqual(expected.XEntryMax, actual.XEntryMax);
 }
        public void Create_WithUpliftVanSlipPlaneConstraints_ReturnsExpectedSlipPlaneConstraints()
        {
            // Setup
            var random = new Random(39);
            var upliftVanSlipPlaneConstraints = new UpliftVanSlipPlaneConstraints(random.NextDouble(), random.NextDouble(),
                                                                                  random.NextDouble(), random.NextDouble());

            // Call
            SlipPlaneConstraints slipPlaneConstraints = SlipPlaneConstraintsCreator.Create(upliftVanSlipPlaneConstraints);

            // Assert
            Assert.AreEqual(upliftVanSlipPlaneConstraints.SlipPlaneMinimumDepth, slipPlaneConstraints.SlipPlaneMinDepth);
            Assert.AreEqual(upliftVanSlipPlaneConstraints.SlipPlaneMinimumLength, slipPlaneConstraints.SlipPlaneMinLength);
            Assert.AreEqual(upliftVanSlipPlaneConstraints.ZoneBoundaryLeft, slipPlaneConstraints.XEntryMin);
            Assert.AreEqual(upliftVanSlipPlaneConstraints.ZoneBoundaryRight, slipPlaneConstraints.XEntryMax);
            Assert.IsNaN(slipPlaneConstraints.XExitMin); // Irrelevant
            Assert.IsNaN(slipPlaneConstraints.XExitMax); // Irrelevant
        }