Index: Application/Riskeer/src/Application.Riskeer/App.xaml.cs =================================================================== diff -u -r68f02442e2e790aaa0bde531c328662819908f10 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Application/Riskeer/src/Application.Riskeer/App.xaml.cs (.../App.xaml.cs) (revision 68f02442e2e790aaa0bde531c328662819908f10) +++ Application/Riskeer/src/Application.Riskeer/App.xaml.cs (.../App.xaml.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -89,7 +89,7 @@ static App() { - SettingsHelper.Instance = new RingtoetsSettingsHelper(); + SettingsHelper.Instance = new RiskeerSettingsHelper(); SetLanguage(); string userDisplay = UserDisplay(); Index: Application/Riskeer/test/Application.Riskeer.Test/AppTest.cs =================================================================== diff -u -rcb6d0d0e0260d373f0ade513d28e6ffcfc28a138 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Application/Riskeer/test/Application.Riskeer.Test/AppTest.cs (.../AppTest.cs) (revision cb6d0d0e0260d373f0ade513d28e6ffcfc28a138) +++ Application/Riskeer/test/Application.Riskeer.Test/AppTest.cs (.../AppTest.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -58,7 +58,7 @@ // Assert Assert.IsInstanceOf(app); - Assert.IsInstanceOf(SettingsHelper.Instance); + Assert.IsInstanceOf(SettingsHelper.Instance); app.Shutdown(); }); } Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs =================================================================== diff -u -r68f02442e2e790aaa0bde531c328662819908f10 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs (.../AssessmentSectionFromFileCommandHandler.cs) (revision 68f02442e2e790aaa0bde531c328662819908f10) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs (.../AssessmentSectionFromFileCommandHandler.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -50,7 +50,7 @@ public class AssessmentSectionFromFileCommandHandler : IAssessmentSectionFromFileCommandHandler { private static readonly ILog log = LogManager.GetLogger(typeof(AssessmentSectionFromFileCommandHandler)); - private readonly string shapeFileDirectory = RingtoetsSettingsHelper.GetCommonDocumentsRingtoetsShapeFileDirectory(); + private readonly string shapeFileDirectory = RiskeerSettingsHelper.GetCommonDocumentsRiskeerShapeFileDirectory(); private readonly IWin32Window dialogParent; private readonly IProjectOwner projectOwner; @@ -95,13 +95,13 @@ } AssessmentSection assessmentSection = GetAssessmentSectionFromDialog(); - var ringtoetsProject = projectOwner.Project as RiskeerProject; - if (assessmentSection == null || ringtoetsProject == null) + var project = projectOwner.Project as RiskeerProject; + if (assessmentSection == null || project == null) { return; } - SetAssessmentSectionToProject(ringtoetsProject, assessmentSection); + SetAssessmentSectionToProject(project, assessmentSection); } #region Dialog Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -1009,54 +1009,54 @@ /// /// Looks up a localized string similar to Database op pad '{0}' gekoppeld.. /// - public static string RingtoetsPlugin_SetBoundaryDatabaseFilePath_Database_on_path_0_linked { + public static string RiskeerPlugin_SetBoundaryDatabaseFilePath_Database_on_path_0_linked { get { - return ResourceManager.GetString("RingtoetsPlugin_SetBoundaryDatabaseFilePath_Database_on_path_0_linked", resourceCulture); + return ResourceManager.GetString("RiskeerPlugin_SetBoundaryDatabaseFilePath_Database_on_path_0_linked", resourceCulture); } } /// /// Looks up a localized string similar to Korte beschrijving van het project.. /// - public static string RingtoetsProjectProperties_Description_Description { + public static string RiskeerProjectProperties_Description_Description { get { - return ResourceManager.GetString("RingtoetsProjectProperties_Description_Description", resourceCulture); + return ResourceManager.GetString("RiskeerProjectProperties_Description_Description", resourceCulture); } } /// /// Looks up a localized string similar to Omschrijving. /// - public static string RingtoetsProjectProperties_Description_DisplayName { + public static string RiskeerProjectProperties_Description_DisplayName { get { - return ResourceManager.GetString("RingtoetsProjectProperties_Description_DisplayName", resourceCulture); + return ResourceManager.GetString("RiskeerProjectProperties_Description_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Naam van het project.. /// - public static string RingtoetsProjectProperties_Name_Description { + public static string RiskeerProjectProperties_Name_Description { get { - return ResourceManager.GetString("RingtoetsProjectProperties_Name_Description", resourceCulture); + return ResourceManager.GetString("RiskeerProjectProperties_Name_Description", resourceCulture); } } /// /// Looks up a localized string similar to Naam. /// - public static string RingtoetsProjectProperties_Name_DisplayName { + public static string RiskeerProjectProperties_Name_DisplayName { get { - return ResourceManager.GetString("RingtoetsProjectProperties_Name_DisplayName", resourceCulture); + return ResourceManager.GetString("RiskeerProjectProperties_Name_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Traject Toevoegen. /// - public static string RingtoetsRibbon_AddAssessmentSection { + public static string RiskeerRibbon_AddAssessmentSection { get { - return ResourceManager.GetString("RingtoetsRibbon_AddAssessmentSection", resourceCulture); + return ResourceManager.GetString("RiskeerRibbon_AddAssessmentSection", resourceCulture); } } Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r2e55afd890468db1b25c734216956ab5c2126e58 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2e55afd890468db1b25c734216956ab5c2126e58) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -153,7 +153,7 @@ HRD database locatie - + Database op pad '{0}' gekoppeld. @@ -204,22 +204,22 @@ ..\Resources\folder-stand32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + Korte beschrijving van het project. - + Omschrijving - + Naam van het project. - + Naam ..\Resources\AddFolder-stand32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + Traject Toevoegen Fisheye: Tag 3e63e58f2e9de8de16ac832b4989b7705c97b443 refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/RingtoetsProjectProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/RiskeerProjectProperties.cs =================================================================== diff -u --- Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/RiskeerProjectProperties.cs (revision 0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/RiskeerProjectProperties.cs (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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 Core.Common.Base.Data; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.PropertyBag; +using Core.Common.Util.Attributes; +using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; +using RiskeerIntegrationFormsResources = Riskeer.Integration.Forms.Properties.Resources; + +namespace Riskeer.Integration.Forms.PropertyClasses +{ + /// + /// This class describes the presentation of properties of a . + /// + public class RiskeerProjectProperties : ObjectProperties + { + [PropertyOrder(1)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RiskeerIntegrationFormsResources), nameof(RiskeerIntegrationFormsResources.RiskeerProjectProperties_Name_DisplayName))] + [ResourcesDescription(typeof(RiskeerIntegrationFormsResources), nameof(RiskeerIntegrationFormsResources.RiskeerProjectProperties_Name_Description))] + public string Name + { + get + { + return data.Name; + } + } + + [PropertyOrder(2)] + [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RiskeerIntegrationFormsResources), nameof(RiskeerIntegrationFormsResources.RiskeerProjectProperties_Description_DisplayName))] + [ResourcesDescription(typeof(RiskeerIntegrationFormsResources), nameof(RiskeerIntegrationFormsResources.RiskeerProjectProperties_Description_Description))] + public string Description + { + get + { + return data.Description; + } + set + { + data.Description = value; + } + } + } +} \ No newline at end of file Fisheye: Tag 3e63e58f2e9de8de16ac832b4989b7705c97b443 refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.Forms/RingtoetsSettingsHelper.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Riskeer.Integration.Forms.csproj =================================================================== diff -u -r9bba38e3ebe3fe261e7c97c338b016681e07c140 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Riskeer.Integration.Forms.csproj (.../Riskeer.Integration.Forms.csproj) (revision 9bba38e3ebe3fe261e7c97c338b016681e07c140) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Riskeer.Integration.Forms.csproj (.../Riskeer.Integration.Forms.csproj) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -86,10 +86,10 @@ + - @@ -105,7 +105,7 @@ ReferenceLineMetaSelectionDialog.cs - + UserControl Index: Riskeer/Integration/src/Riskeer.Integration.Forms/RiskeerSettingsHelper.cs =================================================================== diff -u --- Riskeer/Integration/src/Riskeer.Integration.Forms/RiskeerSettingsHelper.cs (revision 0) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/RiskeerSettingsHelper.cs (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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.Collections.Generic; +using System.IO; +using Core.Common.Util.Settings; + +namespace Riskeer.Integration.Forms +{ + /// + /// Class that defines helper methods related to Riskeer settings. + /// + public class RiskeerSettingsHelper : SettingsHelper + { + /// + /// Gets the directory of the "NBPW" shape file within the common documents directory. + /// + /// Directory path where the "NBPW" shape file can be found. + public static string GetCommonDocumentsRiskeerShapeFileDirectory() + { + string commonDocuments = new RiskeerSettingsHelper().GetCommonDocumentsDirectory(); + return Path.Combine(commonDocuments, "NBPW"); + } + + public override string GetCommonDocumentsDirectory(params string[] subPath) + { + var documentsPath = new List + { + "WTI", + "Ringtoets" + }; + documentsPath.AddRange(subPath); + return base.GetCommonDocumentsDirectory(documentsPath.ToArray()); + } + + public override string GetApplicationLocalUserSettingsDirectory(params string[] subPath) + { + var applicationPath = new List + { + "WTI", + "Ringtoets" + }; + applicationPath.AddRange(subPath); + return base.GetApplicationLocalUserSettingsDirectory(applicationPath.ToArray()); + } + } +} \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionAssemblyCategoriesView.resx =================================================================== diff -u -r2e55afd890468db1b25c734216956ab5c2126e58 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionAssemblyCategoriesView.resx (.../AssessmentSectionAssemblyCategoriesView.resx) (revision 2e55afd890468db1b25c734216956ab5c2126e58) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Views/AssessmentSectionAssemblyCategoriesView.resx (.../AssessmentSectionAssemblyCategoriesView.resx) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -136,7 +136,7 @@ assemblyCategoriesTable - Ringtoets.Integration.Forms.Views.AssessmentSectionAssemblyCategoriesTable, Ringtoets.Common.Forms, Version=18.1.1.1, Culture=neutral, PublicKeyToken=null + Riskeer.Integration.Forms.Views.AssessmentSectionAssemblyCategoriesTable, Riskeer.Common.Forms, Version=18.1.1.1, Culture=neutral, PublicKeyToken=null $this Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r68f02442e2e790aaa0bde531c328662819908f10 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 68f02442e2e790aaa0bde531c328662819908f10) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -295,7 +295,7 @@ /// public override IEnumerable GetPropertyInfos() { - yield return new PropertyInfo(); + yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo { Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RingtoetsRibbon.xaml =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RingtoetsRibbon.xaml (.../RingtoetsRibbon.xaml) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RingtoetsRibbon.xaml (.../RingtoetsRibbon.xaml) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -37,7 +37,7 @@ - + Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Merge/AssessmentSectionMergeFilePathProviderTest.cs =================================================================== diff -u -r86594ccd7329d320872573a1d066fe18959d3cea -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Merge/AssessmentSectionMergeFilePathProviderTest.cs (.../AssessmentSectionMergeFilePathProviderTest.cs) (revision 86594ccd7329d320872573a1d066fe18959d3cea) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Merge/AssessmentSectionMergeFilePathProviderTest.cs (.../AssessmentSectionMergeFilePathProviderTest.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -65,7 +65,7 @@ // Setup var mocks = new MockRepository(); var inquiryHelper = mocks.StrictMock(); - inquiryHelper.Expect(ih => ih.GetSourceFileLocation("Ringtoetsproject (*.rtd)|*.rtd")).Return(expectedFilePath); + inquiryHelper.Expect(ih => ih.GetSourceFileLocation("Riskeerproject (*.rtd)|*.rtd")).Return(expectedFilePath); mocks.ReplayAll(); var provider = new AssessmentSectionMergeFilePathProvider(inquiryHelper); Fisheye: Tag 3e63e58f2e9de8de16ac832b4989b7705c97b443 refers to a dead (removed) revision in file `Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/RingtoetsProjectPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/RiskeerProjectPropertiesTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/RiskeerProjectPropertiesTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/RiskeerProjectPropertiesTest.cs (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -0,0 +1,97 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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.ComponentModel; +using Core.Common.TestUtil; +using NUnit.Framework; +using Riskeer.Integration.Data; +using Riskeer.Integration.Forms.PropertyClasses; + +namespace Riskeer.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class RiskeerProjectPropertiesTest + { + [Test] + public void Name_WithData_ReturnsName() + { + // Setup + var project = new RiskeerProject(); + var properties = new RiskeerProjectProperties + { + Data = project + }; + + const string testName = "some name"; + project.Name = testName; + + // Call + string result = properties.Name; + + // Assert + Assert.AreEqual(testName, result); + } + + [Test] + public void Description_WithData_ReturnsDescription() + { + // Setup + var project = new RiskeerProject(); + var properties = new RiskeerProjectProperties + { + Data = project + }; + + const string testDescription = "some description"; + const string anotherDescription = "another description"; + + project.Description = testDescription; + + // Call + string result = properties.Description; + + // Assert + Assert.AreEqual(testDescription, result); + + // Call + properties.Description = anotherDescription; + + // Assert + Assert.AreEqual(anotherDescription, project.Description); + } + + [Test] + public void GetProperties_Always_ReturnsTwoProperties() + { + // Setup + var properties = new RiskeerProjectProperties + { + Data = new RiskeerProject() + }; + + // Call + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + + // Assert + Assert.AreEqual(2, dynamicProperties.Count); + } + } +} \ No newline at end of file Fisheye: Tag 3e63e58f2e9de8de16ac832b4989b7705c97b443 refers to a dead (removed) revision in file `Riskeer/Integration/test/Riskeer.Integration.Forms.Test/RingtoetsSettingsHelperTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Riskeer.Integration.Forms.Test.csproj =================================================================== diff -u -r9bba38e3ebe3fe261e7c97c338b016681e07c140 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Riskeer.Integration.Forms.Test.csproj (.../Riskeer.Integration.Forms.Test.csproj) (revision 9bba38e3ebe3fe261e7c97c338b016681e07c140) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Riskeer.Integration.Forms.Test.csproj (.../Riskeer.Integration.Forms.Test.csproj) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -81,6 +81,7 @@ + @@ -90,11 +91,10 @@ - - + Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/RiskeerSettingsHelperTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/RiskeerSettingsHelperTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/RiskeerSettingsHelperTest.cs (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -0,0 +1,114 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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.IO; +using Core.Common.Util.Settings; +using NUnit.Framework; + +namespace Riskeer.Integration.Forms.Test +{ + [TestFixture] + public class RiskeerSettingsHelperTest + { + [Test] + public void Constructor_ExpectedProperties() + { + // Call + var settingsHelper = new RiskeerSettingsHelper(); + + // Assert + Assert.IsInstanceOf(settingsHelper); + } + + [Test] + public void GetApplicationLocalUserSettingsDirectory_WithoutParams_ReturnsExpectedDirectory() + { + // Setup + var settingsHelper = new RiskeerSettingsHelper(); + + // Call + string localUserSettingsDirectory = settingsHelper.GetApplicationLocalUserSettingsDirectory(); + + // Assert + string localApplicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + string expectedPath = Path.Combine(localApplicationDataPath, "WTI", "Ringtoets"); + Assert.AreEqual(expectedPath, localUserSettingsDirectory); + } + + [Test] + public void GetApplicationLocalUserSettingsDirectory_WithParams_ReturnsExpectedDirectory() + { + // Setup + var settingsHelper = new RiskeerSettingsHelper(); + string localApplicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + string rootPath = Path.Combine(localApplicationDataPath, "WTI", "Ringtoets"); + + // Call + string localUserSettingsDirectory = settingsHelper.GetApplicationLocalUserSettingsDirectory("subFolder", "subSubFolder"); + + // Assert + string expectedPath = Path.Combine(rootPath, "subFolder", "subSubFolder"); + Assert.AreEqual(expectedPath, localUserSettingsDirectory); + } + + [Test] + public void GetCommonDocumentsRiskeerDirectory_WithoutParams_ReturnsExpectedDirectory() + { + // Setup + var settingsHelper = new RiskeerSettingsHelper(); + + // Call + string pathFromSettings = settingsHelper.GetCommonDocumentsDirectory(); + + // Assert + string expectedPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), "WTI", "Ringtoets"); + Assert.AreEqual(expectedPath, pathFromSettings); + } + + [Test] + public void GetCommonDocumentsRiskeerDirectory_WithParams_ReturnsExpectedDirectory() + { + // Setup + var settingsHelper = new RiskeerSettingsHelper(); + + // Call + string pathFromSettings = settingsHelper.GetCommonDocumentsDirectory("some folder"); + + // Assert + string expectedPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), "WTI", "Ringtoets", "some folder"); + Assert.AreEqual(expectedPath, pathFromSettings); + } + + [Test] + public void GetCommonDocumentsRiskeerShapeFileDirectory_ReturnsExpectedDirectory() + { + // Setup + string expectedPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), "WTI", "Ringtoets", "NBPW"); + + // Call + string pathFromSettings = RiskeerSettingsHelper.GetCommonDocumentsRiskeerShapeFileDirectory(); + + // Assert + Assert.AreEqual(expectedPath, pathFromSettings); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r68f02442e2e790aaa0bde531c328662819908f10 -r3e63e58f2e9de8de16ac832b4989b7705c97b443 --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 68f02442e2e790aaa0bde531c328662819908f10) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 3e63e58f2e9de8de16ac832b4989b7705c97b443) @@ -228,7 +228,7 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, typeof(IProject), - typeof(RingtoetsProjectProperties)); + typeof(RiskeerProjectProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos,