public void Constructor_ExpectedValues()
        {
            // Setup
            var phreaticLines = new WaternetPhreaticLineResult[0];
            var waternetLines = new WaternetLineResult[0];

            // Call
            var result = new WaternetCalculatorResult(phreaticLines, waternetLines);

            // Assert
            Assert.AreSame(phreaticLines, result.PhreaticLines);
            Assert.AreSame(waternetLines, result.WaternetLines);
        }
Exemplo n.º 2
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            const string name     = "Line";
            var          geometry = new[]
            {
                new Point2D(0, 0),
                new Point2D(1, 1)
            };

            // Call
            var phreaticLine = new WaternetPhreaticLineResult(name, geometry);

            // Assert
            Assert.AreEqual(name, phreaticLine.Name);
            Assert.AreSame(geometry, phreaticLine.Geometry);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new <see cref="WaternetCalculatorResult"/>.
        /// </summary>
        /// <returns>The created <see cref="WaternetCalculatorResult"/>.</returns>
        public static WaternetCalculatorResult Create()
        {
            var phreaticLine = new WaternetPhreaticLineResult("Line 1", new[]
            {
                new Point2D(0, 0),
                new Point2D(10, 0)
            });

            return(new WaternetCalculatorResult(new[]
            {
                phreaticLine
            }, new[]
            {
                new WaternetLineResult("Line 2", new[]
                {
                    new Point2D(2, 2),
                    new Point2D(3, 3)
                }, phreaticLine)
            }));
        }
Exemplo n.º 4
0
        private static WaternetCalculatorResult CreateWaternetCalculatorResult()
        {
            var phreaticLineResult = new WaternetPhreaticLineResult("Line 1", new[]
            {
                new Point2D(0, 0),
                new Point2D(10, 0)
            });

            return(new WaternetCalculatorResult(
                       new[]
            {
                phreaticLineResult
            }, new[]
            {
                new WaternetLineResult("Line 2", new[]
                {
                    new Point2D(0, 2),
                    new Point2D(10, 2)
                }, phreaticLineResult)
            }));
        }
Exemplo n.º 5
0
 private static MacroStabilityInwardsPhreaticLine ConvertPhreaticLine(WaternetPhreaticLineResult phreaticLine)
 {
     return(new MacroStabilityInwardsPhreaticLine(phreaticLine.Name, phreaticLine.Geometry));
 }
 /// <summary>
 /// Asserts whether <paramref name="actual"/> is equal to <paramref name="expected"/>.
 /// </summary>
 /// <param name="expected">The expected <see cref="HeadLine"/>.</param>
 /// <param name="actual">The actual <see cref="WaternetPhreaticLineResult"/>.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="actual"/>
 /// is not equal to <paramref name="expected"/>.</exception>
 private static void AssertPhreaticLine(HeadLine expected, WaternetPhreaticLineResult actual)
 {
     Assert.AreEqual(expected.Name, actual.Name);
     CollectionAssert.AreEqual(expected.Points.Select(p => new Point2D(p.X, p.Z)), actual.Geometry);
 }