// Copyright (C) Stichting Deltares 2016. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets 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 System.Linq;
using NUnit.Framework;
using Ringtoets.HydraRing.Calculation.Data;
using Ringtoets.HydraRing.Calculation.Data.Input.Structures;
namespace Ringtoets.HydraRing.Calculation.Test.Data.Input.Structures
{
[TestFixture]
public class StructuresStabilityPointFloodedCulvertLinearCalculationInputTest
{
[Test]
public void Constructor_ExpectedValues()
{
// Setup
const int hydraulicBoundaryLocationId = 1000;
var hydraRingSection = new HydraRingSection(1, double.NaN, double.NaN);
var forelandPoints = Enumerable.Empty();
// Call
var input = new StructuresStabilityPointFloodedCulvertLinearCalculationInput(hydraulicBoundaryLocationId, hydraRingSection,
forelandPoints);
// Assert
Assert.IsInstanceOf(input);
Assert.AreEqual(hydraulicBoundaryLocationId, input.HydraulicBoundaryLocationId);
Assert.AreEqual(1, input.CalculationTypeId);
Assert.AreEqual(58, input.VariableId);
Assert.AreEqual(HydraRingFailureMechanismType.StructuresStructuralFailure, input.FailureMechanismType);
Assert.AreSame(hydraRingSection, input.Section);
Assert.AreSame(forelandPoints, input.ForelandsPoints);
}
[Test]
[TestCase(423, null)]
[TestCase(424, 107)]
[TestCase(425, 113)]
[TestCase(430, 114)]
[TestCase(435, 116)]
[TestCase(436, null)]
public void GetSubMechanismModelId_Always_ReturnsExpectedValues(int subMechanismModelId, int? expectedSubMechanismModelId)
{
// Setup
var input = new StructuresStabilityPointFloodedCulvertLinearCalculationInput(111, new HydraRingSection(1, double.NaN, double.NaN),
Enumerable.Empty());
// Call
int? actualSubmechanismModelId = input.GetSubMechanismModelId(subMechanismModelId);
// Assert
Assert.AreEqual(expectedSubMechanismModelId, actualSubmechanismModelId);
}
}
}