// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of the application DAM - UI. // // DAM - UI is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. namespace Deltares.Dam.Tests { using NUnit.Framework; using Deltares.Dam.Data; [TestFixture] public class GaugePLLineTest { [TestFixtureSetUp] public void TestFixtureSetup() { } [SetUp] public void TestSetup() { } [Test] public void TestCreate() { GaugePLLine gaugePLLine = new GaugePLLine(PLLineType.PL1); Assert.IsNotNull(gaugePLLine); } [Test] public void TestIntegrity() { GaugePLLine gaugePLLine = new GaugePLLine(PLLineType.PL3); Gauge gauge1 = new Gauge() { Name = "Gauge 1" }; Gauge gauge2 = new Gauge() { Name = "Gauge 2" }; Gauge gauge3 = new Gauge() { Name = "Gauge 3" }; Gauge gauge4 = new Gauge() { Name = "Gauge 4" }; gaugePLLine.Points.Add(new GaugePLLinePoint(1.1, 2.1, gauge1.Name, gauge2.Name)); gaugePLLine.Points.Add(new GaugePLLinePoint(1.1, 2.100001, gauge3.Name, gauge4.Name)); Assert.AreEqual(PLLineType.PL3, gaugePLLine.PLLineType); Assert.AreEqual(2, gaugePLLine.Points.Count); Assert.IsTrue(gaugePLLine.Points[1].LocationEquals(gaugePLLine.Points[0], 0.0001)); Assert.AreEqual(gauge1.Name, gaugePLLine.Points[0].GaugeIDX); Assert.AreEqual(gauge2.Name, gaugePLLine.Points[0].GaugeIDZ); Assert.AreEqual(gauge3.Name, gaugePLLine.Points[1].GaugeIDX); Assert.AreEqual(gauge4.Name, gaugePLLine.Points[1].GaugeIDZ); } } }