Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/AssessmentSectionConverter.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/AssessmentSectionConverter.cs (.../AssessmentSectionConverter.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Converters/AssessmentSectionConverter.cs (.../AssessmentSectionConverter.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -21,8 +21,6 @@ using System; using Application.Ringtoets.Storage.DbContext; - -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; @@ -65,11 +63,6 @@ return assessmentSection; } - private AssessmentSectionComposition GetAssessmentSectionComposition(short composition) - { - return (AssessmentSectionComposition)composition; - } - /// /// Converts to . /// @@ -91,7 +84,7 @@ } entity.AssessmentSectionEntityId = modelObject.StorageId; entity.Name = modelObject.Name; - entity.Composition = (short)modelObject.Composition; + entity.Composition = (short) modelObject.Composition; entity.Norm = modelObject.FailureMechanismContribution.Norm; if (modelObject.HydraulicBoundaryDatabase != null) @@ -100,5 +93,10 @@ entity.HydraulicDatabaseVersion = modelObject.HydraulicBoundaryDatabase.Version; } } + + private AssessmentSectionComposition GetAssessmentSectionComposition(short composition) + { + return (AssessmentSectionComposition) composition; + } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Persistors/AssessmentSectionPersistorTest.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Persistors/AssessmentSectionPersistorTest.cs (.../AssessmentSectionPersistorTest.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Persistors/AssessmentSectionPersistorTest.cs (.../AssessmentSectionPersistorTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -29,8 +29,6 @@ using Application.Ringtoets.Storage.TestUtil; using NUnit.Framework; using Rhino.Mocks; - -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; @@ -127,7 +125,7 @@ } }, HydraulicDatabaseVersion = hydraulicDatabaseVersion, HydraulicDatabaseLocation = hydraulicDatabasePath, - Composition = (short)composition, + Composition = (short) composition, HydraulicLocationEntities = new List { new HydraulicLocationEntity @@ -188,7 +186,7 @@ { AssessmentSectionEntityId = 1, Name = "test1", Norm = 12, HydraulicDatabaseVersion = "1.0", HydraulicDatabaseLocation = "temp/test", - Composition = (short)AssessmentSectionComposition.Dune, + Composition = (short) AssessmentSectionComposition.Dune, HydraulicLocationEntities = new List { new HydraulicLocationEntity @@ -201,7 +199,7 @@ { AssessmentSectionEntityId = 2, Name = "test2", Norm = 22, HydraulicDatabaseVersion = "2.0", HydraulicDatabaseLocation = "test", - Composition = (short)AssessmentSectionComposition.Dike, + Composition = (short) AssessmentSectionComposition.Dike, HydraulicLocationEntities = new List { new HydraulicLocationEntity @@ -224,7 +222,7 @@ { Assert.AreEqual(parentNavigationPropertyList[i].AssessmentSectionEntityId, loadedModelsList[i].StorageId); Assert.AreEqual(parentNavigationPropertyList[i].Name, loadedModelsList[i].Name); - Assert.AreEqual((AssessmentSectionComposition)parentNavigationPropertyList[i].Composition, loadedModelsList[i].Composition); + Assert.AreEqual((AssessmentSectionComposition) parentNavigationPropertyList[i].Composition, loadedModelsList[i].Composition); Assert.AreEqual(parentNavigationPropertyList[i].Norm, loadedModelsList[i].FailureMechanismContribution.Norm); Assert.AreEqual(parentNavigationPropertyList[i].HydraulicDatabaseVersion, loadedModelsList[i].HydraulicBoundaryDatabase.Version); Assert.AreEqual(parentNavigationPropertyList[i].HydraulicDatabaseLocation, loadedModelsList[i].HydraulicBoundaryDatabase.FilePath); @@ -316,7 +314,7 @@ Assert.AreEqual(0, entity.AssessmentSectionEntityId); Assert.AreEqual(name, entity.Name); Assert.AreEqual(norm, entity.Norm); - Assert.AreEqual((short)composition, entity.Composition); + Assert.AreEqual((short) composition, entity.Composition); mockRepository.VerifyAll(); } @@ -482,7 +480,7 @@ var entity = parentNavigationPropertyList[0]; Assert.AreEqual(0, entity.AssessmentSectionEntityId); Assert.AreEqual(name, entity.Name); - Assert.AreEqual((short)composition, entity.Composition); + Assert.AreEqual((short) composition, entity.Composition); Assert.AreEqual(norm, entity.Norm); mockRepository.VerifyAll(); @@ -600,7 +598,7 @@ AssessmentSectionEntityId = storageId, Name = "old name", Norm = 1, - Composition = (short)AssessmentSectionComposition.Dune + Composition = (short) AssessmentSectionComposition.Dune } }; AssessmentSection assessmentSection = new AssessmentSection(composition) @@ -623,7 +621,7 @@ var entity = parentNavigationPropertyList[0]; Assert.AreEqual(storageId, entity.AssessmentSectionEntityId); Assert.AreEqual(name, entity.Name); - Assert.AreEqual((short)composition, entity.Composition); + Assert.AreEqual((short) composition, entity.Composition); Assert.AreEqual(norm, entity.Norm); mockRepository.VerifyAll(); @@ -654,7 +652,7 @@ AssessmentSectionEntityId = storageId, Name = "Entity to update", Norm = 1, - Composition = (short)AssessmentSectionComposition.Dune + Composition = (short) AssessmentSectionComposition.Dune } }; @@ -680,7 +678,7 @@ Assert.IsInstanceOf(entity); Assert.AreEqual(storageId, entity.AssessmentSectionEntityId); Assert.AreEqual(name, entity.Name); - Assert.AreEqual((short)composition, entity.Composition); + Assert.AreEqual((short) composition, entity.Composition); Assert.AreEqual(norm, entity.Norm); mockRepository.VerifyAll(); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqLiteTest.cs =================================================================== diff -u -r4477e75623600b68603b5f96175eea2431fe1cd5 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqLiteTest.cs (.../StorageSqLiteTest.cs) (revision 4477e75623600b68603b5f96175eea2431fe1cd5) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/StorageSqLiteTest.cs (.../StorageSqLiteTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,4 +1,25 @@ -using System; +// 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; using System.Data; using System.Data.SQLite; using System.IO; @@ -91,7 +112,8 @@ // Setup var expectedMessage = String.Format(@"Fout bij het lezen van bestand '{0}': ", tempRingtoetsFile); var expectedInnerExceptionMessage = "An error occurred while executing the command definition. See the inner exception for details."; - var expectedInnerExceptionInnerExceptionMessage = "SQL logic error or missing database\r\nno such table: ProjectEntity"; + var expectedInnerExceptionInnerExceptionMessage = "SQL logic error or missing database" + Environment.NewLine + + "no such table: ProjectEntity"; using (new FileDisposeHelper(tempRingtoetsFile)) { Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectHelper.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectHelper.cs (.../RingtoetsProjectHelper.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectHelper.cs (.../RingtoetsProjectHelper.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -22,7 +22,6 @@ using System.Collections.Generic; using Core.Common.Base.Data; using Core.Common.Base.Geometry; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionComposition.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionComposition.cs (.../AssessmentSectionComposition.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/AssessmentSectionComposition.cs (.../AssessmentSectionComposition.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -30,12 +30,14 @@ /// The assessment section consists only out of 'dike' elements. /// Dike = 0, + /// /// The assessment section consists only out of 'dune' elements. /// Dune = 1, + /// - /// The assessment section consists out of a combination of 'dike' and 'dune' elements + /// The assessment section consists out of a combination of 'dike' and 'dune' elements. /// DikeAndDune = 2 } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs (.../FailureMechanismContribution.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs (.../FailureMechanismContribution.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; - using Core.Common.Base; using Core.Common.Utils.Extensions; using Ringtoets.Common.Data.FailureMechanism; @@ -96,15 +95,14 @@ /// /// The new failure mechanisms. /// The collective contribution for other failure mechanisms. - /// newFailureMechanisms + /// Thrown when is null. /// Thrown when: /// /// any of the has a value for /// not in interval [0,100]. /// the value of is not in interval [0,100] /// /// - /// Thrown when is null. public void UpdateContributions(IEnumerable newFailureMechanisms, double otherContribution) { if (newFailureMechanisms == null) Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContributionContext.cs =================================================================== diff -u -r66ee69642e1342ee03613d7d73831346f00d269c -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContributionContext.cs (.../FailureMechanismContributionContext.cs) (revision 66ee69642e1342ee03613d7d73831346f00d269c) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismContributionContext.cs (.../FailureMechanismContributionContext.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -20,7 +20,6 @@ // All rights reserved. using System; - using Core.Common.Base; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionTest.cs (.../FailureMechanismContributionTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionTest.cs (.../FailureMechanismContributionTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,16 +1,34 @@ -using System; +// 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; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; - using Core.Common.TestUtil; - using NUnit.Framework; - using Rhino.Mocks; - using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Properties; namespace Ringtoets.Common.Data.Test.Contribution { @@ -32,12 +50,9 @@ var random = new Random(21); var contribution = random.Next(1, 100); var norm = random.Next(1, int.MaxValue); - + // Call - TestDelegate test = () => - { - new FailureMechanismContribution(null, contribution, norm); - }; + TestDelegate test = () => { new FailureMechanismContribution(null, contribution, norm); }; // Assert const string expectedMessage = "Kan geen bijdrageoverzicht maken zonder faalmechanismen."; @@ -71,13 +86,10 @@ { // Setup var random = new Random(21); - var contribution = random.Next(1,100); + var contribution = random.Next(1, 100); // Call - TestDelegate test = () => - { - new FailureMechanismContribution(Enumerable.Empty(), contribution, norm); - }; + TestDelegate test = () => { new FailureMechanismContribution(Enumerable.Empty(), contribution, norm); }; // Assert const string expectedMessage = "De faalkansbijdrage kan alleen bepaald worden als de norm van het traject groter is dan 0."; @@ -96,13 +108,10 @@ var norm = random.Next(1, int.MaxValue); // Call - TestDelegate test = () => - { - new FailureMechanismContribution(Enumerable.Empty(), contribution, norm); - }; + TestDelegate test = () => { new FailureMechanismContribution(Enumerable.Empty(), contribution, norm); }; // Assert - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, Properties.Resources.Contribution_Value_should_be_in_interval_0_100); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, Resources.Contribution_Value_should_be_in_interval_0_100); } [Test] @@ -276,18 +285,10 @@ newOtherContribution }; CollectionAssert.AreEqual(contributionValues, failureMechanismContribution.Distribution.Select(d => d.Contribution)); - CollectionAssert.AreEqual(Enumerable.Repeat(norm, 4), failureMechanismContribution.Distribution.Select(d => d.Norm)); - mocks.VerifyAll(); } - private void AssertFailureProbabilitySpace(double newOtherContribution, int norm, double probabilitySpace) - { - double expectedProbabilitySpace = (norm / newOtherContribution) * 100.0; - Assert.AreEqual(expectedProbabilitySpace, probabilitySpace); - } - [Test] public void Norm_WhenUpdated_NormUpdatedForEachFailureMechanismContributionItem() { @@ -301,13 +302,22 @@ mockRepository.ReplayAll(); - var failureMechanismContribution = new FailureMechanismContribution(new[] { failureMechanism }, otherContribution, norm); + var failureMechanismContribution = new FailureMechanismContribution(new[] + { + failureMechanism + }, otherContribution, norm); // Call failureMechanismContribution.Norm = newNorm; // Assert - Assert.AreEqual(Enumerable.Repeat(newNorm,2) , failureMechanismContribution.Distribution.Select(d => d.Norm)); + Assert.AreEqual(Enumerable.Repeat(newNorm, 2), failureMechanismContribution.Distribution.Select(d => d.Norm)); } + + private void AssertFailureProbabilitySpace(double newOtherContribution, int norm, double probabilitySpace) + { + double expectedProbabilitySpace = (norm/newOtherContribution)*100.0; + Assert.AreEqual(expectedProbabilitySpace, probabilitySpace); + } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -80,6 +80,9 @@ + + Copying.licenseheader + Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs (.../FailureMechanismContributionContextTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs (.../FailureMechanismContributionContextTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,14 +1,30 @@ -using System; -using System.Linq; +// 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; +using System.Linq; using Core.Common.Base; using Core.Common.TestUtil; - using NUnit.Framework; - using Rhino.Mocks; - -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -r638c0c354f63b4c8be69feb448712b004d8bb933 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 638c0c354f63b4c8be69feb448712b004d8bb933) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -109,6 +109,9 @@ + + Copying.licenseheader + Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -21,11 +21,8 @@ using System; using System.Collections.Generic; - using Core.Common.Base; using Core.Common.Base.Geometry; - -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -19,13 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System.Linq; using System.Windows.Forms; using Core.Common.Base; using Core.Components.DotSpatial.Forms; using Core.Components.Gis.Data; using Core.Components.Gis.Forms; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Integration.Forms.Properties; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; @@ -93,7 +91,7 @@ private void SetDataToMap() { mapControl.Data.Name = Resources.AssessmentSectionMap_DisplayName; - + if (data != null) { // Bottommost layer @@ -103,7 +101,6 @@ } mapControl.Data.NotifyObservers(); - } private MapData AddOrUpdateMapData(MapData oldMapData, MapData newMapData) Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs =================================================================== diff -u -r66ee69642e1342ee03613d7d73831346f00d269c -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs (.../FailureMechanismContributionView.cs) (revision 66ee69642e1342ee03613d7d73831346f00d269c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs (.../FailureMechanismContributionView.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -22,16 +22,12 @@ using System; using System.Linq; using System.Windows.Forms; - using Core.Common.Base; using Core.Common.Controls.Views; using Core.Common.Utils.Reflection; - using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Forms.PresentationObjects; - using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; using CommonGuiResources = Core.Common.Gui.Properties.Resources; using RingtoetsIntegrationFormsResources = Ringtoets.Integration.Forms.Properties.Resources; @@ -64,30 +60,30 @@ SubscribeEvents(); } - public object Data + /// + /// Gets and sets the assessment section this view belongs to. + /// + public IAssessmentSection AssessmentSection { get { - return data; + return assessmentSection; } set { - HandleNewDataSet((FailureMechanismContribution)value); + HandleNewAssessmentSectionSet(value); } } - /// - /// Gets and sets the assessment section this view belongs to. - /// - public IAssessmentSection AssessmentSection + public object Data { get { - return assessmentSection; + return data; } set { - HandleNewAssessmentSectionSet(value); + HandleNewDataSet((FailureMechanismContribution) value); } } @@ -100,7 +96,7 @@ /// /// Clean up any resources being used. /// - /// true if managed resources should be disposed; otherwise, false. + /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) @@ -305,9 +301,9 @@ MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.OK) { - assessmentSection.ChangeComposition((AssessmentSectionComposition)assessmentSectionCompositionComboBox.SelectedValue); + assessmentSection.ChangeComposition((AssessmentSectionComposition) assessmentSectionCompositionComboBox.SelectedValue); SetGridDataSource(); - foreach (ICalculationItem calculation in assessmentSection.GetFailureMechanisms().SelectMany(failureMechanism => failureMechanism.CalculationItems)) + foreach (ICalculationItem calculation in assessmentSection.GetFailureMechanisms().SelectMany(failureMechanism => failureMechanism.CalculationItems)) { calculation.ClearOutput(); calculation.NotifyObservers(); Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -rfa424689d48793c024e73bfcee1c202559eea3e0 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision fa424689d48793c024e73bfcee1c202559eea3e0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -94,38 +94,6 @@ } } - private void RemoveOnOpenProjectListener(IProjectOwner projectOwner) - { - if (projectOwner != null) - { - projectOwner.ProjectOpened -= VerifyHydraulicBoundaryDatabasePath; - } - } - - private void AddOnOpenProjectListener(IProjectOwner projectOwner) - { - if (projectOwner != null) - { - projectOwner.ProjectOpened += VerifyHydraulicBoundaryDatabasePath; - } - } - - private void VerifyHydraulicBoundaryDatabasePath(Project project) - { - var sectionsWithDatabase = project.Items.OfType().Where(i => i.HydraulicBoundaryDatabase != null); - foreach (IAssessmentSection section in sectionsWithDatabase) - { - string selectedFile = section.HydraulicBoundaryDatabase.FilePath; - var validationProblem = HydraulicDatabaseHelper.ValidatePathForCalculation(selectedFile); - if(validationProblem != null) - { - log.WarnFormat( - Resources.RingtoetsGuiPlugin_VerifyHydraulicBoundaryDatabasePath_Hydraulic_boundary_database_connection_failed_0_, - validationProblem); - } - } - } - /// /// Returns all instances provided for data of . /// @@ -292,6 +260,38 @@ }; } + private void RemoveOnOpenProjectListener(IProjectOwner projectOwner) + { + if (projectOwner != null) + { + projectOwner.ProjectOpened -= VerifyHydraulicBoundaryDatabasePath; + } + } + + private void AddOnOpenProjectListener(IProjectOwner projectOwner) + { + if (projectOwner != null) + { + projectOwner.ProjectOpened += VerifyHydraulicBoundaryDatabasePath; + } + } + + private static void VerifyHydraulicBoundaryDatabasePath(Project project) + { + var sectionsWithDatabase = project.Items.OfType().Where(i => i.HydraulicBoundaryDatabase != null); + foreach (IAssessmentSection section in sectionsWithDatabase) + { + string selectedFile = section.HydraulicBoundaryDatabase.FilePath; + var validationProblem = HydraulicDatabaseHelper.ValidatePathForCalculation(selectedFile); + if (validationProblem != null) + { + log.WarnFormat( + Resources.RingtoetsGuiPlugin_VerifyHydraulicBoundaryDatabasePath_Hydraulic_boundary_database_connection_failed_0_, + validationProblem); + } + } + } + #region FailureMechanismContributionContext ViewInfo private static bool CloseFailureMechanismContributionViewForData(FailureMechanismContributionView view, object o) Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs =================================================================== diff -u -rfa424689d48793c024e73bfcee1c202559eea3e0 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision fa424689d48793c024e73bfcee1c202559eea3e0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/AssessmentSectionTest.cs (.../AssessmentSectionTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,4 +1,25 @@ -using System; +// 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; using System.Linq; using Core.Common.Base; using Core.Common.Base.Geometry; @@ -34,7 +55,8 @@ var grassRevetmentName = "Dijken - Grasbekledingen"; var duneErosionName = "Duinen - Erosie"; - var names = new[] { + var names = new[] + { pipingName, grassErosionName, macrostailityInwardName, @@ -89,7 +111,6 @@ { // Setup var section = new AssessmentSection(AssessmentSectionComposition.Dike); - const string newValue = "new value"; // Call @@ -104,7 +125,6 @@ { // Setup var section = new AssessmentSection(AssessmentSectionComposition.Dike); - const string newValue = "new comment value"; // Call @@ -164,7 +184,7 @@ Assert.AreEqual(failureMechanisms[i].Name, contribution[i].Assessment); Assert.AreEqual(failureMechanisms[i].Contribution, contribution[i].Contribution); Assert.AreEqual(norm, contribution[i].Norm); - Assert.AreEqual((norm / contribution[i].Contribution) * 100, contribution[i].ProbabilitySpace); + Assert.AreEqual((norm/contribution[i].Contribution)*100, contribution[i].ProbabilitySpace); } Assert.AreEqual("Overig", contribution[10].Assessment); double expectedOtherContribution = composition == AssessmentSectionComposition.DikeAndDune ? 20.0 : 30.0; @@ -182,20 +202,72 @@ { // Setup var initialComposition = composition == AssessmentSectionComposition.Dike ? - AssessmentSectionComposition.Dune : + AssessmentSectionComposition.Dune : AssessmentSectionComposition.Dike; var assessmentSection = new AssessmentSection(initialComposition); // Precondition Assert.AreNotEqual(assessmentSection.Composition, composition); - + // Call assessmentSection.ChangeComposition(composition); // Assert AssertExpectedContributions(composition, assessmentSection); } + [Test] + public void ReferenceLine_SetNewValue_GetNewValue() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + var referenceLine = new ReferenceLine(); + + // Call + assessmentSection.ReferenceLine = referenceLine; + + // Assert + Assert.AreSame(referenceLine, assessmentSection.ReferenceLine); + } + + [Test] + public void ReferenceLine_SomeReferenceLine_GeneralPipingInputSectionLengthSet() + { + // Setup + var random = new Random(21); + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ReferenceLine referenceLine = new ReferenceLine(); + + Point2D[] somePointsCollection = + { + new Point2D(random.NextDouble(), random.NextDouble()), + new Point2D(random.NextDouble(), random.NextDouble()), + new Point2D(random.NextDouble(), random.NextDouble()), + new Point2D(random.NextDouble(), random.NextDouble()) + }; + referenceLine.SetGeometry(somePointsCollection); + + // Call + assessmentSection.ReferenceLine = referenceLine; + + // Assert + Assert.AreEqual(Math2D.Length(referenceLine.Points), assessmentSection.PipingFailureMechanism.SemiProbabilisticInput.SectionLength); + } + + [Test] + public void ReferenceLine_Null_GeneralPipingInputSectionLengthNaN() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + // Call + assessmentSection.ReferenceLine = null; + + // Assert + Assert.AreEqual(double.NaN, assessmentSection.PipingFailureMechanism.SemiProbabilisticInput.SectionLength); + } + private void AssertExpectedContributions(AssessmentSectionComposition composition, AssessmentSection assessmentSection) { double[] contributions = GetContributionsArray(composition); @@ -216,7 +288,7 @@ private static double[] GetContributionsArray(AssessmentSectionComposition composition) { - double[] contributions; + double[] contributions = null; switch (composition) { case AssessmentSectionComposition.Dike: @@ -269,62 +341,9 @@ break; default: Assert.Fail("{0} does not have expectancy implemented!", composition); - contributions = null; break; } return contributions; } - - [Test] - public void ReferenceLine_SetNewValue_GetNewValue() - { - // Setup - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); - - var referenceLine = new ReferenceLine(); - - // Call - assessmentSection.ReferenceLine = referenceLine; - - // Assert - Assert.AreSame(referenceLine, assessmentSection.ReferenceLine); - } - - [Test] - public void ReferenceLine_SomeReferenceLine_GeneralPipingInputSectionLengthSet() - { - // Setup - var random = new Random(21); - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); - ReferenceLine referenceLine = new ReferenceLine(); - - Point2D[] somePointsCollection = - { - new Point2D(random.NextDouble(), random.NextDouble()), - new Point2D(random.NextDouble(), random.NextDouble()), - new Point2D(random.NextDouble(), random.NextDouble()), - new Point2D(random.NextDouble(), random.NextDouble()) - }; - referenceLine.SetGeometry(somePointsCollection); - - // Call - assessmentSection.ReferenceLine = referenceLine; - - // Assert - Assert.AreEqual(Math2D.Length(referenceLine.Points), assessmentSection.PipingFailureMechanism.SemiProbabilisticInput.SectionLength); - } - - [Test] - public void ReferenceLine_Null_GeneralPipingInputSectionLengthNaN() - { - // Setup - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); - - // Call - assessmentSection.ReferenceLine = null; - - // Assert - Assert.AreEqual(double.NaN, assessmentSection.PipingFailureMechanism.SemiProbabilisticInput.SectionLength); - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismContributionContextTreeNodeInfoTest.cs =================================================================== diff -u -r66ee69642e1342ee03613d7d73831346f00d269c -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismContributionContextTreeNodeInfoTest.cs (.../FailureMechanismContributionContextTreeNodeInfoTest.cs) (revision 66ee69642e1342ee03613d7d73831346f00d269c) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismContributionContextTreeNodeInfoTest.cs (.../FailureMechanismContributionContextTreeNodeInfoTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,12 +1,31 @@ -using System.Linq; +// 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 Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; - -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; @@ -93,7 +112,7 @@ { // Setup var contribution = new FailureMechanismContribution(Enumerable.Empty(), 100.0, 150000); - + var assessmentSection = mocks.Stub(); var context = new FailureMechanismContributionContext(contribution, assessmentSection); var treeViewControlMock = mocks.StrictMock(); @@ -111,7 +130,6 @@ mocks.ReplayAll(); - using (var plugin = new RingtoetsGuiPlugin()) { var info = GetInfo(plugin); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; @@ -28,7 +29,6 @@ using Core.Components.DotSpatial.Forms; using Core.Components.Gis.Data; using NUnit.Framework; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; @@ -328,7 +328,7 @@ public void ChangeComposition(AssessmentSectionComposition newComposition) { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/FailureMechanismContributionViewTest.cs =================================================================== diff -u -r66ee69642e1342ee03613d7d73831346f00d269c -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/FailureMechanismContributionViewTest.cs (.../FailureMechanismContributionViewTest.cs) (revision 66ee69642e1342ee03613d7d73831346f00d269c) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/FailureMechanismContributionViewTest.cs (.../FailureMechanismContributionViewTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,4 +1,25 @@ -using System; +// 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; using System.Windows.Forms; using Core.Common.Base; using NUnit.Extensions.Forms; @@ -7,7 +28,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Integration.Data; using Ringtoets.Integration.Forms.Views; @@ -16,10 +36,6 @@ [TestFixture] public class FailureMechanismContributionViewTest : NUnitFormTest { - private const string normInputTextBoxName = "normInput"; - private const string dataGridViewControlName = "probabilityDistributionGrid"; - private const string assessmentSectionCompositionComboBoxName = "assessmentSectionCompositionComboBox"; - private Form testForm; [SetUp] @@ -231,7 +247,7 @@ ShowFormWithView(view); // Then - var dataGridView = (DataGridView)new ControlTester(dataGridViewControlName).TheObject; + var dataGridView = (DataGridView) new ControlTester(dataGridViewControlName).TheObject; DataGridViewRow zeroContributionFailureMechanismRow = dataGridView.Rows[0]; DataGridViewCell probabilitySpaceCell = zeroContributionFailureMechanismRow.Cells[2]; @@ -269,11 +285,11 @@ ShowFormWithView(view); // Then - var dataGridView = (DataGridView)new ControlTester(dataGridViewControlName).TheObject; + var dataGridView = (DataGridView) new ControlTester(dataGridViewControlName).TheObject; DataGridViewRow zeroContributionFailureMechanismRow = dataGridView.Rows[0]; DataGridViewCell probabilitySpaceCell = zeroContributionFailureMechanismRow.Cells[2]; - Assert.AreEqual("1/#,#" , probabilitySpaceCell.InheritedStyle.Format); + Assert.AreEqual("1/#,#", probabilitySpaceCell.InheritedStyle.Format); string expectedTextValue = new FailureMechanismContributionItem(failureMechanismStub, norm) .ProbabilitySpace.ToString(probabilitySpaceCell.InheritedStyle.Format, probabilitySpaceCell.InheritedStyle.FormatProvider); @@ -300,7 +316,7 @@ view.AssessmentSection = assessmentSection; // Call - var compositionComboBox = (ComboBox)new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; + var compositionComboBox = (ComboBox) new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; // Assert Assert.AreEqual(expectedDisplayText, compositionComboBox.Text); @@ -329,10 +345,10 @@ // Precondition Assert.AreNotEqual(assessmentSection.Composition, newComposition); - var compositionComboBox = (ComboBox)new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; + var compositionComboBox = (ComboBox) new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; int dataGridInvalidatedCallCount = 0; - var contributionGridView = (DataGridView)new ControlTester(dataGridViewControlName).TheObject; + var contributionGridView = (DataGridView) new ControlTester(dataGridViewControlName).TheObject; contributionGridView.Invalidated += (sender, args) => dataGridInvalidatedCallCount++; string messageBoxTitle = null, messageBoxText = null; @@ -379,7 +395,7 @@ Assert.AreNotEqual(assessmentSection.Composition, newComposition); int dataGridInvalidatedCallCount = 0; - var contributionGridView = (DataGridView)new ControlTester(dataGridViewControlName).TheObject; + var contributionGridView = (DataGridView) new ControlTester(dataGridViewControlName).TheObject; contributionGridView.Invalidated += (sender, args) => dataGridInvalidatedCallCount++; DialogBoxHandler = (name, wnd) => @@ -388,7 +404,7 @@ messageBox.ClickOk(); }; - var compositionComboBox = (ComboBox)new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; + var compositionComboBox = (ComboBox) new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; // Call compositionComboBox.SelectedValue = newComposition; @@ -435,15 +451,14 @@ messageBox.ClickOk(); }; - var compositionComboBox = (ComboBox)new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; + var compositionComboBox = (ComboBox) new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; // Call compositionComboBox.SelectedValue = newComposition; // Assert mocks.VerifyAll(); // Expect UpdateObserver call } - } [Test] @@ -484,7 +499,7 @@ var failureMechanisms = new[] { - failureMechanism1, + failureMechanism1, failureMechanism2 }; @@ -507,7 +522,7 @@ Assert.AreNotEqual(assessmentSection.Composition, newComposition); int dataGridInvalidatedCallCount = 0; - var contributionGridView = (DataGridView)new ControlTester(dataGridViewControlName).TheObject; + var contributionGridView = (DataGridView) new ControlTester(dataGridViewControlName).TheObject; contributionGridView.Invalidated += (sender, args) => dataGridInvalidatedCallCount++; DialogBoxHandler = (name, wnd) => @@ -516,7 +531,7 @@ messageBox.ClickOk(); }; - var compositionComboBox = (ComboBox)new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; + var compositionComboBox = (ComboBox) new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; // Call compositionComboBox.SelectedValue = newComposition; @@ -583,10 +598,10 @@ Assert.AreNotEqual(assessmentSection.Composition, newComposition); int dataGridInvalidatedCallCount = 0; - var contributionGridView = (DataGridView)new ControlTester(dataGridViewControlName).TheObject; + var contributionGridView = (DataGridView) new ControlTester(dataGridViewControlName).TheObject; contributionGridView.Invalidated += (sender, args) => dataGridInvalidatedCallCount++; - var compositionComboBox = (ComboBox)new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; + var compositionComboBox = (ComboBox) new ControlTester(assessmentSectionCompositionComboBoxName).TheObject; DialogBoxHandler = (name, wnd) => { @@ -605,6 +620,10 @@ } } + private const string normInputTextBoxName = "normInput"; + private const string dataGridViewControlName = "probabilityDistributionGrid"; + private const string assessmentSectionCompositionComboBoxName = "assessmentSectionCompositionComboBox"; + private void ShowFormWithView(FailureMechanismContributionView distributionView) { testForm.Controls.Add(distributionView); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -r149c1b4d30710a88480556b70ba2b49015b1dded -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 149c1b4d30710a88480556b70ba2b49015b1dded) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -156,6 +156,9 @@ + + Copying.licenseheader + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs =================================================================== diff -u -r66ee69642e1342ee03613d7d73831346f00d269c -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs (.../FailureMechanismContributionViewInfoTest.cs) (revision 66ee69642e1342ee03613d7d73831346f00d269c) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs (.../FailureMechanismContributionViewInfoTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,5 +1,25 @@ -using System.Linq; +// 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 Core.Common.Gui.Plugin; using Core.Common.TestUtil; using NUnit.Framework; @@ -38,8 +58,6 @@ public void GetViewName_Always_ReturnsViewName() { // Setup - mocks.ReplayAll(); - var view = new FailureMechanismContributionView(); var failureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), 30, 1000); @@ -106,6 +124,7 @@ // Assert Assert.AreSame(viewData, contribution); + mocks.VerifyAll(); } [Test] @@ -132,6 +151,7 @@ // Assert Assert.IsTrue(closeForData); + mocks.VerifyAll(); } [Test] @@ -153,7 +173,6 @@ .Return(AssessmentSectionComposition.DikeAndDune); mocks.ReplayAll(); - var view = new FailureMechanismContributionView { Data = contribution1, @@ -165,6 +184,7 @@ // Assert Assert.IsFalse(closeForData); + mocks.VerifyAll(); } [Test] @@ -175,7 +195,7 @@ var assessmentSection = mocks.Stub(); assessmentSection.Stub(section => section.FailureMechanismContribution) - .Return(contribution); + .Return(contribution); mocks.ReplayAll(); var view = new FailureMechanismContributionView(); @@ -185,6 +205,7 @@ // Assert Assert.IsFalse(closeForData); + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SemiProbabilisticPipingInput.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Piping/src/Ringtoets.Piping.Data/SemiProbabilisticPipingInput.cs (.../SemiProbabilisticPipingInput.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SemiProbabilisticPipingInput.cs (.../SemiProbabilisticPipingInput.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,4 +1,25 @@ -using System; +// 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; using Ringtoets.Common.Data.Properties; namespace Ringtoets.Piping.Data @@ -57,6 +78,5 @@ /// Gets or sets the return period to assess for. /// public int Norm { get; set; } - } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/SemiProbabilisticPipingInputTest.cs =================================================================== diff -u -r2389ee6ea48d7014101ea90df5db340b44407c12 -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/SemiProbabilisticPipingInputTest.cs (.../SemiProbabilisticPipingInputTest.cs) (revision 2389ee6ea48d7014101ea90df5db340b44407c12) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/SemiProbabilisticPipingInputTest.cs (.../SemiProbabilisticPipingInputTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,7 +1,26 @@ -using System; +// 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; using Core.Common.TestUtil; - using NUnit.Framework; namespace Ringtoets.Piping.Data.Test @@ -43,7 +62,7 @@ [Test] [TestCase(-1e-6)] [TestCase(-123.545)] - [TestCase(100+1e-6)] + [TestCase(100 + 1e-6)] [TestCase(5678.9)] public void Contribution_SetNewInvalidValue_ThrowArgumentOutOfRangeException(double newContributionValue) { Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismViewTest.cs (.../PipingFailureMechanismViewTest.cs) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) @@ -1,4 +1,25 @@ -using System; +// 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; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -10,7 +31,6 @@ using Core.Components.Gis.Data; using NUnit.Framework; using Rhino.Mocks; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism;