// Copyright (C) Stichting Deltares 2025. 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. using Deltares.Dam.Data; using NUnit.Framework; namespace Deltares.Dam.Tests { [TestFixture] public class GaugePLLineTest { [SetUp] public void TestFixtureSetup() {} [SetUp] public void TestSetup() {} [Test] public void TestCreate() { var gaugePLLine = new GaugePLLine(PLLineType.PL1); Assert.That(gaugePLLine, Is.Not.Null); } [Test] public void TestIntegrity() { var gaugePLLine = new GaugePLLine(PLLineType.PL3); var gauge1 = new Gauge { Name = "Gauge 1" }; var gauge2 = new Gauge { Name = "Gauge 2" }; var gauge3 = new Gauge { Name = "Gauge 3" }; var 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.That(gaugePLLine.PLLineType, Is.EqualTo(PLLineType.PL3)); Assert.That(gaugePLLine.Points.Count, Is.EqualTo(2)); Assert.That(gaugePLLine.Points[1].LocationEquals(gaugePLLine.Points[0], 0.0001), Is.True); Assert.That(gaugePLLine.Points[0].GaugeIDX, Is.EqualTo(gauge1.Name)); Assert.That(gaugePLLine.Points[0].GaugeIDZ, Is.EqualTo(gauge2.Name)); Assert.That(gaugePLLine.Points[1].GaugeIDX, Is.EqualTo(gauge3.Name)); Assert.That(gaugePLLine.Points[1].GaugeIDZ, Is.EqualTo(gauge4.Name)); } } }