Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/GeneralResultTest.cs =================================================================== diff -u -re0c69303985f5ad57106c5b7f18700d1a16ae3b3 -r57b198a3f80256e02b871d8de11c05d9f2dcf311 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/GeneralResultTest.cs (.../GeneralResultTest.cs) (revision e0c69303985f5ad57106c5b7f18700d1a16ae3b3) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/GeneralResultTest.cs (.../GeneralResultTest.cs) (revision 57b198a3f80256e02b871d8de11c05d9f2dcf311) @@ -131,7 +131,7 @@ } [Test] - public void Constructor_IllustrationPointsNotUnique_ThrowArgumentException() + public void Constructor_TopLevelIllustrationPointsNotUnique_ThrowArgumentException() { // Setup WindDirection windDirection = WindDirectionTestFactory.CreateTestWindDirection(); @@ -155,6 +155,61 @@ } [Test] + public void Constructor_StochastsNotUnique_ThrowArgumentException() + { + // Setup + WindDirection windDirection = WindDirectionTestFactory.CreateTestWindDirection(); + IEnumerable stochasts = new[] + { + new Stochast("Stochast 1", 0, 0), + new Stochast("Stochast 1", 0, 0) + }; + IEnumerable topLevelIllustrationPoints = new List(); + + // Call + TestDelegate test = () => new GeneralResult(windDirection, + stochasts, + topLevelIllustrationPoints); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("Een of meerdere stochasten hebben dezelfde naam. " + + "Het uitlezen van illustratiepunten wordt overgeslagen.", + exception.Message); + } + + [Test] + public void Constructor_ChildStochastsNotInStochasts_ThrowArgumentException() + { + // Setup + WindDirection windDirection = WindDirectionTestFactory.CreateTestWindDirection(); + IEnumerable stochasts = new[] + { + new Stochast("Stochast 1", 0, 0) + }; + var illustrationPointNode = new IllustrationPointNode(new FaultTreeIllustrationPoint("A", 0.0, new [] + { + new Stochast("Stochast 2", 0, 0) + }, CombinationType.And)); + + IEnumerable topLevelIllustrationPoints = new List + { + new TopLevelFaultTreeIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), "closing", illustrationPointNode) + }; + + // Call + TestDelegate test = () => new GeneralResult(windDirection, + stochasts, + topLevelIllustrationPoints); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("De stochasten van een illustratiepunt bevatten niet dezelfde stochasten als de illustratiepunten die het punt bevat. " + + "Het uitlezen van illustratiepunten wordt overgeslagen.", + exception.Message); + } + + [Test] public void Clone_Always_ReturnNewInstanceWithCopiedValues() { // Setup