Index: Core/Common/src/Core.Common.Base/IO/IFileExporter.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Base/IO/IFileExporter.cs (.../IFileExporter.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Base/IO/IFileExporter.cs (.../IFileExporter.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -19,9 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using System.Drawing; - namespace Core.Common.Base.IO { /// @@ -30,42 +27,10 @@ public interface IFileExporter { /// - /// Gets the name of the . + /// This method performs the export routine. /// - string Name { get; } - - /// - /// Gets the category of the . - /// - string Category { get; } - - /// - /// Gets the image of the . - /// - /// This image can be used in selection and/or progress dialogs. - Bitmap Image { get; } - - /// - /// Gets the of the item supported by the . - /// - Type SupportedItemType { get; } - - /// - /// Gets the file filter of the . - /// - /// - /// An example string would be: - /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2" - /// - string FileFilter { get; } - - /// - /// This method exports the data of an item to a file at the given location. - /// - /// The item to export the data from. - /// The path of the file to export the data to. - /// true if the export was successful. false otherwise. + /// true if the export was successful, false otherwise. /// Implementations of this export method are allowed to throw exceptions of any kind. - bool Export(object sourceItem, string filePath); + bool Export(); } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs =================================================================== diff -u -r5b9a225deb21ddb302ddfd070154f61cd2d1b091 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs (.../ExportImportCommandHandler.cs) (revision 5b9a225deb21ddb302ddfd070154f61cd2d1b091) +++ Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs (.../ExportImportCommandHandler.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -24,8 +24,8 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Base.IO; +using Core.Common.Gui.Plugin; using Core.Common.Gui.Properties; -using Core.Common.Utils.Reflection; using log4net; namespace Core.Common.Gui.Commands @@ -38,7 +38,6 @@ private static readonly ILog log = LogManager.GetLogger(typeof(ExportImportCommandHandler)); private readonly IEnumerable fileImporters; - private readonly IEnumerable fileExporters; private readonly GuiImportHandler importHandler; private readonly GuiExportHandler exportHandler; @@ -47,13 +46,12 @@ /// /// The parent window onto which dialogs should be shown. /// An enumeration of . - /// An enumeration of . - public ExportImportCommandHandler(IWin32Window dialogParent, IEnumerable fileImporters, IEnumerable fileExporters) + /// An enumeration of . + public ExportImportCommandHandler(IWin32Window dialogParent, IEnumerable fileImporters, IEnumerable exportInfos) { this.fileImporters = fileImporters; - this.fileExporters = fileExporters; importHandler = new GuiImportHandler(dialogParent, this.fileImporters); - exportHandler = new GuiExportHandler(dialogParent, this.fileExporters); + exportHandler = new GuiExportHandler(dialogParent, exportInfos); } public bool CanImportOn(object target) @@ -82,31 +80,12 @@ public bool CanExportFrom(object obj) { - return GetSupportedFileExporters(obj).Any(); + return exportHandler.GetSupportedExportInfos(obj).Any(); } - public void ExportFrom(object data, IFileExporter exporter = null) + public void ExportFrom(object data) { - if (exporter == null) - { - exportHandler.ExportFrom(data); - } - else - { - exportHandler.GetExporterDialog(exporter, data); - } + exportHandler.ExportFrom(data); } - - private IEnumerable GetSupportedFileExporters(object source) - { - if (source == null) - { - return Enumerable.Empty(); - } - - var sourceType = source.GetType(); - - return fileExporters.Where(fe => (fe.SupportedItemType == sourceType || sourceType.Implements(fe.SupportedItemType))); - } } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs =================================================================== diff -u -r3e0ac8e7988d37424638e2b768e15a783897e126 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision 3e0ac8e7988d37424638e2b768e15a783897e126) +++ Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -23,8 +23,8 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; -using Core.Common.Base.IO; using Core.Common.Gui.Forms; +using Core.Common.Gui.Plugin; using Core.Common.Gui.Properties; using Core.Common.Utils.Reflection; using log4net; @@ -40,17 +40,17 @@ private static readonly Bitmap brickImage = Resources.brick; private readonly IWin32Window dialogParent; - private readonly IEnumerable fileExporter; + private readonly IEnumerable exportInfos; /// /// Initializes a new instance of the class. /// /// The parent window to show dialogs on top. - /// An enumeration of . - public GuiExportHandler(IWin32Window dialogParent, IEnumerable fileExporter) + /// An enumeration of . + public GuiExportHandler(IWin32Window dialogParent, IEnumerable exportInfos) { this.dialogParent = dialogParent; - this.fileExporter = fileExporter; + this.exportInfos = exportInfos; } /// @@ -61,30 +61,31 @@ /// The export source. public void ExportFrom(object item) { - var exporter = GetSupportedExporterForItemUsingDialog(item); - if (exporter == null) + var exportInfo = GetSupportedExportInfoUsingDialog(item); + if (exportInfo == null) { return; } - GetExporterDialog(exporter, item); + + GetExporterDialog(exportInfo, item); } /// - /// Ask the user for the target file to export data to, then perform the export + /// Asks the user for the target file to export data to, then performs the export /// using the source object. /// - /// The importer to use. - /// The import target. - public void GetExporterDialog(IFileExporter exporter, object selectedItem) + /// The export information to use. + /// The export source. + public void GetExporterDialog(ExportInfo exportInfo, object selectedItem) { - ExporterItemUsingFileOpenDialog(exporter, selectedItem); + ExportItemUsingFileOpenDialog(exportInfo, selectedItem); } - private IFileExporter GetSupportedExporterForItemUsingDialog(object itemToExport) + private ExportInfo GetSupportedExportInfoUsingDialog(object itemToExport) { - var fileExporters = GetSupportedFileExporters(itemToExport).ToArray(); + var supportedExportInfos = GetSupportedExportInfos(itemToExport).ToArray(); - if (fileExporters.Length == 0) + if (supportedExportInfos.Length == 0) { MessageBox.Show(Resources.GuiExportHandler_GetSupportedExporterForItemUsingDialog_No_exporter_for_this_item_available, Resources.GuiExportHandler_GetSupportedExporterForItemUsingDialog_Error); @@ -93,54 +94,60 @@ return null; } - // If there is only one available exporter use that: - if (fileExporters.Length == 1) + if (supportedExportInfos.Length == 1) { - return fileExporters[0]; + return supportedExportInfos[0]; } - using (var selectExporterDialog = new SelectItemDialog(dialogParent)) + using (var selectExportInfoDialog = new SelectItemDialog(dialogParent)) { - foreach (var fileExporter in fileExporters) + foreach (var exportInfo in supportedExportInfos) { - selectExporterDialog.AddItemType(fileExporter.Name, fileExporter.Category, fileExporter.Image ?? brickImage, null); + selectExportInfoDialog.AddItemType(exportInfo.Name, exportInfo.Category, exportInfo.Image ?? brickImage, null); } - if (selectExporterDialog.ShowDialog() == DialogResult.OK) + if (selectExportInfoDialog.ShowDialog() == DialogResult.OK) { - return fileExporters.First(i => i.Name == selectExporterDialog.SelectedItemTypeName); + return supportedExportInfos.First(info => info.Name == selectExportInfoDialog.SelectedItemTypeName); } } return null; } - private IEnumerable GetSupportedFileExporters(object source) + /// + /// Gets an enumeration of supported objects for the provided . + /// + /// The data object to get the supported objects for. + /// An enumeration of supported objects. + public IEnumerable GetSupportedExportInfos(object source) { if (source == null) { - return Enumerable.Empty(); + return Enumerable.Empty(); } var sourceType = source.GetType(); - return fileExporter.Where(fe => (fe.SupportedItemType == sourceType || sourceType.Implements(fe.SupportedItemType))); + return exportInfos.Where(info => info.DataType == sourceType || sourceType.Implements(info.DataType)); } - private void ExporterItemUsingFileOpenDialog(IFileExporter exporter, object item) + private void ExportItemUsingFileOpenDialog(ExportInfo exportInfo, object item) { log.Info(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Start_exporting); - var windowTitle = string.Format(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Select_a_DataType_0_file_to_export_to, exporter.Name); + var windowTitle = string.Format(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Select_a_DataType_0_file_to_export_to, exportInfo.Name); using (var saveFileDialog = new SaveFileDialog { - Filter = exporter.FileFilter, + Filter = exportInfo.FileFilter, Title = windowTitle, FilterIndex = 2 }) { if (saveFileDialog.ShowDialog(dialogParent) == DialogResult.OK) { - if (exporter.Export(item, saveFileDialog.FileName)) + var exporter = exportInfo.CreateFileExporter(item, saveFileDialog.FileName); + + if (exporter.Export()) { log.Info(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Finished_exporting); } Index: Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs =================================================================== diff -u -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs (.../IExportImportCommandHandler.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) +++ Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs (.../IExportImportCommandHandler.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -65,7 +65,6 @@ /// /// /// The data to export. - /// Optional: The specific exporter to use. - void ExportFrom(object data, IFileExporter exporter = null); + void ExportFrom(object data); } } \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj =================================================================== diff -u -ra32bbe3919b6babd74ae4867e8337662aed0dad2 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision a32bbe3919b6babd74ae4867e8337662aed0dad2) +++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -136,6 +136,7 @@ + Index: Core/Common/src/Core.Common.Gui/GuiCore.cs =================================================================== diff -u -ra5a1a727ccd295ebb9f22e661eaba874e025718c -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision a5a1a727ccd295ebb9f22e661eaba874e025718c) +++ Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -119,7 +119,7 @@ storageCommandHandler = new StorageCommandHandler(projectStore, this, MainWindow); exportImportCommandHandler = new ExportImportCommandHandler(MainWindow, Plugins.SelectMany(p => p.GetFileImporters()), - Plugins.SelectMany(p => p.GetFileExporters())); + Plugins.SelectMany(p => p.GetExportInfos())); WindowsApplication.EnableVisualStyles(); ViewPropertyEditor.ViewCommands = ViewCommands; Index: Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs (revision 0) +++ Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -0,0 +1,144 @@ +// 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 Lesser 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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.Drawing; +using Core.Common.Base.IO; + +namespace Core.Common.Gui.Plugin +{ + /// + /// Information for creating an exporter for a particular data object. + /// + public class ExportInfo + { + /// + /// Gets or sets the data type associated with this export info. + /// + public Type DataType { get; set; } + + /// + /// Gets or sets the method used to create a . Function arguments: + /// + /// The data to export. + /// The output file path. + /// out - The created exporter. + /// + /// + public Func CreateFileExporter { get; set; } + + /// + /// Gets or sets the name of the export information. + /// + public string Name { get; set; } + + /// + /// Gets or sets the category of the export information. + /// + public string Category { get; set; } + + /// + /// Gets or sets the image of the export information. + /// + public Image Image { get; set; } + + /// + /// Gets or sets the file filter of the export information. + /// + /// + /// An example string would be: + /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2" + /// + public string FileFilter { get; set; } + } + + /// + /// Information for creating an exporter for a particular data object. + /// + /// The data type associated with this export info. + public class ExportInfo + { + /// + /// Gets the data type associated with this export info. + /// + public Type DataType + { + get + { + return typeof(TData); + } + } + + /// + /// Gets or sets the method used to create a . Function arguments: + /// + /// The data to export. + /// The output file path. + /// out - The created exporter. + /// + /// + public Func CreateFileExporter { get; set; } + + /// + /// Gets or sets the name of the export information. + /// + public string Name { get; set; } + + /// + /// Gets or sets the category of the export information. + /// + public string Category { get; set; } + + /// + /// Gets or sets the image of the export information. + /// + public Image Image { get; set; } + + /// + /// Gets or sets the file filter of the export information. + /// + /// + /// An example string would be: + /// "My file format1 (*.ext1)|*.ext1|My file format2 (*.ext2)|*.ext2" + /// + public string FileFilter { get; set; } + + /// + /// Performs an implicit conversion from to . + /// + /// The export information to convert. + /// The result of the conversion. + public static implicit operator ExportInfo(ExportInfo exportInfo) + { + return new ExportInfo + { + DataType = exportInfo.DataType, + CreateFileExporter = (data, filePath) => exportInfo.CreateFileExporter != null + ? exportInfo.CreateFileExporter((TData) data, filePath) + : null, + Name = exportInfo.Name, + Category = exportInfo.Category, + Image = exportInfo.Image, + FileFilter = exportInfo.FileFilter + }; + } + } +} \ No newline at end of file Index: Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs =================================================================== diff -u -ra32bbe3919b6babd74ae4867e8337662aed0dad2 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs (.../PluginBase.cs) (revision a32bbe3919b6babd74ae4867e8337662aed0dad2) +++ Core/Common/src/Core.Common.Gui/Plugin/PluginBase.cs (.../PluginBase.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -69,10 +69,10 @@ } /// - /// This method returns an enumeration of . + /// This method returns an enumeration of . /// - /// The enumeration of provided by the . - public virtual IEnumerable GetFileExporters() + /// The enumeration of provided by the . + public virtual IEnumerable GetExportInfos() { yield break; } Index: Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs =================================================================== diff -u -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5) +++ Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -20,13 +20,12 @@ // All rights reserved. using System; - using Core.Common.Gui.PropertyBag; namespace Core.Common.Gui.Plugin { /// - /// Information for creating object properties. + /// Information for creating object properties for a particular data object. /// public class PropertyInfo { @@ -76,14 +75,14 @@ } /// - /// Information for creating object properties. + /// Information for creating object properties for a particular data object. /// /// The type of the object to create object properties for. /// The type of the object properties to create. public class PropertyInfo where TProperty : IObjectProperties { /// - /// Gets or sets the type of the data to create properties for. + /// Gets the type of the data to create properties for. /// public Type DataType { @@ -94,7 +93,7 @@ } /// - /// Gets or sets the type of object properties to create. + /// Gets the type of object properties to create. /// public Type PropertyObjectType { @@ -141,20 +140,22 @@ /// /// Performs an implicit conversion from to . /// - public static implicit operator PropertyInfo(PropertyInfo pi) + /// The property information to convert. + /// The result of the conversion. + public static implicit operator PropertyInfo(PropertyInfo propertyInfo) { return new PropertyInfo { DataType = typeof(TObject), PropertyObjectType = typeof(TProperty), - AdditionalDataCheck = pi.AdditionalDataCheck != null - ? o => pi.AdditionalDataCheck((TObject) o) + AdditionalDataCheck = propertyInfo.AdditionalDataCheck != null + ? o => propertyInfo.AdditionalDataCheck((TObject) o) : (Func) null, - GetObjectPropertiesData = pi.GetObjectPropertiesData != null - ? o => pi.GetObjectPropertiesData((TObject) o) + GetObjectPropertiesData = propertyInfo.GetObjectPropertiesData != null + ? o => propertyInfo.GetObjectPropertiesData((TObject) o) : (Func) null, - AfterCreate = pi.AfterCreate != null - ? op => pi.AfterCreate((TProperty) op) + AfterCreate = propertyInfo.AfterCreate != null + ? op => propertyInfo.AfterCreate((TProperty) op) : (Action) null }; } Index: Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs =================================================================== diff -u -r223b2a4edc4ac816051c7eeecb735c34a6246574 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision 223b2a4edc4ac816051c7eeecb735c34a6246574) +++ Core/Common/src/Core.Common.Gui/Plugin/ViewInfo.cs (.../ViewInfo.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -121,7 +121,7 @@ public class ViewInfo where TView : IView { /// - /// Gets or sets the data type associated with this view info. + /// Gets the data type associated with this view info. /// public Type DataType { @@ -132,7 +132,7 @@ } /// - /// Gets or sets the type of data used for the view. + /// Gets the type of data used for the view. /// public Type ViewDataType { @@ -143,7 +143,7 @@ } /// - /// Gets or sets the type of the view. + /// Gets the type of the view. /// public Type ViewType { @@ -217,10 +217,8 @@ /// /// Performs an implicit conversion from to . /// - /// The view information. - /// - /// The result of the conversion. - /// + /// The view information to convert. + /// The result of the conversion. public static implicit operator ViewInfo(ViewInfo viewInfo) { return new ViewInfo Index: Core/Common/test/Core.Common.Gui.Test/Commands/ExportImportCommandHandlerTest.cs =================================================================== diff -u -rf67a4a5faeca53255e37c31e7eb849e5dd8d54f9 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/test/Core.Common.Gui.Test/Commands/ExportImportCommandHandlerTest.cs (.../ExportImportCommandHandlerTest.cs) (revision f67a4a5faeca53255e37c31e7eb849e5dd8d54f9) +++ Core/Common/test/Core.Common.Gui.Test/Commands/ExportImportCommandHandlerTest.cs (.../ExportImportCommandHandlerTest.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -24,6 +24,7 @@ using System.Windows.Forms; using Core.Common.Base.IO; using Core.Common.Gui.Commands; +using Core.Common.Gui.Plugin; using NUnit.Framework; using Rhino.Mocks; @@ -39,10 +40,10 @@ var mocks = new MockRepository(); var dialogParent = mocks.Stub(); var fileImporters = Enumerable.Empty(); - var fileExporters = Enumerable.Empty(); + var exportInfos = Enumerable.Empty(); mocks.ReplayAll(); - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isImportPossible = commandHandler.CanImportOn(new object()); @@ -68,9 +69,9 @@ { objectImporter }; - var fileExporters = Enumerable.Empty(); + var exportInfos = Enumerable.Empty(); - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isImportPossible = commandHandler.CanImportOn(target); @@ -95,9 +96,9 @@ { objectImporter }; - var fileExporters = Enumerable.Empty(); + var exportInfos = Enumerable.Empty(); - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isImportPossible = commandHandler.CanImportOn(target); @@ -124,9 +125,9 @@ { objectImporter1, objectImporter2 }; - var fileExporters = Enumerable.Empty(); + var exportInfos = Enumerable.Empty(); - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isImportPossible = commandHandler.CanImportOn(target); @@ -153,9 +154,9 @@ { objectImporter1, objectImporter2 }; - var fileExporters = Enumerable.Empty(); + var exportInfos = Enumerable.Empty(); - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isImportPossible = commandHandler.CanImportOn(target); @@ -174,9 +175,9 @@ mocks.ReplayAll(); var fileImporters = Enumerable.Empty(); - var fileExporters = Enumerable.Empty(); + var exportInfos = Enumerable.Empty(); - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isExportPossible = commandHandler.CanExportFrom(new object()); @@ -190,21 +191,17 @@ public void CanExportFrom_HasOneFileExporterForTarget_ReturnTrue() { // Setup - var target = new object(); var mocks = new MockRepository(); var dialogParent = mocks.Stub(); - var objectExporter = mocks.Stub(); - objectExporter.Stub(i => i.SupportedItemType) - .Return(target.GetType()); mocks.ReplayAll(); var fileImporters = Enumerable.Empty(); - var fileExporters = new List + var exportInfos = new List { - objectExporter + new ExportInfo() }; - var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); + var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, exportInfos); // Call var isExportPossible = commandHandler.CanExportFrom(new object()); @@ -218,23 +215,15 @@ public void CanExportFrom_HasMultipleFileExportersForTarget_ReturnTrue() { // Setup - var target = new object(); var mocks = new MockRepository(); var dialogParent = mocks.Stub(); - var objectExporter1 = mocks.Stub(); - objectExporter1.Stub(i => i.SupportedItemType) - .Return(target.GetType()); - var objectExporter2 = mocks.Stub(); - objectExporter2.Stub(i => i.SupportedItemType) - .Return(target.GetType()); - mocks.ReplayAll(); var fileImporters = Enumerable.Empty(); - var fileExporters = new List + var fileExporters = new List { - objectExporter1, - objectExporter2 + new ExportInfo(), + new ExportInfo() }; var commandHandler = new ExportImportCommandHandler(dialogParent, fileImporters, fileExporters); Index: Core/Common/test/Core.Common.Gui.Test/Commands/GuiExportHandlerTest.cs =================================================================== diff -u -rf566e21cccf5b760e3f3856065a49917fde1b877 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/test/Core.Common.Gui.Test/Commands/GuiExportHandlerTest.cs (.../GuiExportHandlerTest.cs) (revision f566e21cccf5b760e3f3856065a49917fde1b877) +++ Core/Common/test/Core.Common.Gui.Test/Commands/GuiExportHandlerTest.cs (.../GuiExportHandlerTest.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -21,10 +21,10 @@ using System; using System.Collections.Generic; -using System.Drawing; using Core.Common.Base.IO; using Core.Common.Gui.Commands; using Core.Common.Gui.Forms.MainWindow; +using Core.Common.Gui.Plugin; using Core.Common.TestUtil; using NUnit.Extensions.Forms; using NUnit.Framework; @@ -41,12 +41,13 @@ public void ExportFrom_NoExporterAvailable_GivesMessageBoxAndLogsMessage(object exportFrom) { // Setup - var fileImporters = new List(); var mockRepository = new MockRepository(); var mainWindow = mockRepository.Stub(); mockRepository.ReplayAll(); - string messageBoxTitle = null, messageBoxText = null; + string messageBoxText = null; + string messageBoxTitle = null; + DialogBoxHandler = (name, wnd) => { var messageBox = new MessageBoxTester(wnd); @@ -57,7 +58,7 @@ messageBox.ClickOk(); }; - var exportHandler = new GuiExportHandler(mainWindow, fileImporters); + var exportHandler = new GuiExportHandler(mainWindow, new List()); // Call Action call = () => exportHandler.ExportFrom(exportFrom); @@ -75,12 +76,12 @@ { // Setup var mockRepository = new MockRepository(); - var unsupportedFileExporter = mockRepository.Stub(); - unsupportedFileExporter.Stub(i => i.SupportedItemType).Return(typeof(String)); // Wrong type var mainWindow = mockRepository.Stub(); mockRepository.ReplayAll(); - string messageBoxTitle = null, messageBoxText = null; + string messageBoxText = null; + string messageBoxTitle = null; + DialogBoxHandler = (name, wnd) => { var messageBox = new MessageBoxTester(wnd); @@ -91,11 +92,10 @@ messageBox.ClickOk(); }; - var fileImporters = new List + var exportHandler = new GuiExportHandler(mainWindow, new List { - unsupportedFileExporter - }; - var exportHandler = new GuiExportHandler(mainWindow, fileImporters); + GetUnsupportedExportInfo() + }); // Call Action call = () => exportHandler.ExportFrom(null); @@ -122,11 +122,10 @@ messageBox.ClickCancel(); }; - var fileImporters = new List + var exportHandler = new GuiExportHandler(mainWindow, new List { - new IntegerFileExporter() - }; - var exportHandler = new GuiExportHandler(mainWindow, fileImporters); + GetIntegerExportInfo() + }); // Call Action call = () => exportHandler.ExportFrom(1234); @@ -145,20 +144,17 @@ var mainWindow = mockRepository.Stub(); mockRepository.ReplayAll(); - var exportFile = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui, "exportFile.txt"); ModalFormHandler = (name, wnd, form) => { var messageBox = new SaveFileDialogTester(wnd); - messageBox.SaveFile(exportFile); + messageBox.SaveFile(TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui, "exportFile.txt")); }; - var fileImporters = new List + var exportHandler = new GuiExportHandler(mainWindow, new List { - new IntegerFileExporter() - }; + GetIntegerExportInfo() + }); - var exportHandler = new GuiExportHandler(mainWindow, fileImporters); - // Call Action call = () => exportHandler.ExportFrom(1234); @@ -178,23 +174,19 @@ // Setup var mockRepository = new MockRepository(); var mainWindow = mockRepository.Stub(); - var unsupportedFileExporter = mockRepository.Stub(); - unsupportedFileExporter.Stub(i => i.SupportedItemType).Return(typeof(String)); // Wrong type mockRepository.ReplayAll(); - var exportFile = TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui, "exportFile.txt"); ModalFormHandler = (name, wnd, form) => { var messageBox = new SaveFileDialogTester(wnd); - messageBox.SaveFile(exportFile); + messageBox.SaveFile(TestHelper.GetTestDataPath(TestDataPath.Core.Common.Gui, "exportFile.txt")); }; - var fileImporters = new List + var exportHandler = new GuiExportHandler(mainWindow, new List { - unsupportedFileExporter, - new IntegerFileExporter() - }; - var exportHandler = new GuiExportHandler(mainWindow, fileImporters); + GetUnsupportedExportInfo(), + GetIntegerExportInfo() + }); // Call Action call = () => exportHandler.ExportFrom(1234); @@ -208,37 +200,23 @@ mockRepository.VerifyAll(); } - private class IntegerFileExporter : IFileExporter + private static ExportInfo GetUnsupportedExportInfo() { - public string Name - { - get - { - return "IntegerFileExporter"; - } - } + return new ExportInfo(); + } - public string Category { get; private set; } - public Bitmap Image { get; private set; } - - public Type SupportedItemType + private static ExportInfo GetIntegerExportInfo() + { + return new ExportInfo { - get - { - return typeof(Int32); - } - } + CreateFileExporter = (data, filePath) => new IntegerFileExporter() + }; + } - public string FileFilter + private class IntegerFileExporter : IFileExporter + { + public bool Export() { - get - { - return "Text files (*.txt)|*.txt"; - } - } - - public bool Export(object sourceItem, string filePath) - { return true; } } Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj =================================================================== diff -u -ra32bbe3919b6babd74ae4867e8337662aed0dad2 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision a32bbe3919b6babd74ae4867e8337662aed0dad2) +++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -108,6 +108,7 @@ TestView.cs + Index: Core/Common/test/Core.Common.Gui.Test/Plugin/ExportInfoTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Gui.Test/Plugin/ExportInfoTest.cs (revision 0) +++ Core/Common/test/Core.Common.Gui.Test/Plugin/ExportInfoTest.cs (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -0,0 +1,127 @@ +// 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 Lesser 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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.Drawing; +using Core.Common.Base.IO; +using Core.Common.Gui.Plugin; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Core.Common.Gui.Test.Plugin +{ + [TestFixture] + public class ExportInfoTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var info = new ExportInfo(); + + // Assert + Assert.IsNull(info.DataType); + Assert.IsNull(info.CreateFileExporter); + Assert.IsNullOrEmpty(info.Name); + Assert.IsNullOrEmpty(info.Category); + Assert.IsNull(info.Image); + Assert.IsNullOrEmpty(info.FileFilter); + } + + [Test] + public void DefaultGenericConstructor_ExpectedValues() + { + // Call + var info = new ExportInfo(); + + // Assert + Assert.AreEqual(typeof(int), info.DataType); + Assert.IsNull(info.CreateFileExporter); + Assert.IsNullOrEmpty(info.Name); + Assert.IsNullOrEmpty(info.Category); + Assert.IsNull(info.Image); + Assert.IsNullOrEmpty(info.FileFilter); + } + + [Test] + public void ImplicitOperator_OptionalDelegatesAndPropertiesSet_ExportInfoFullyConverted() + { + // Setup + var mocks = new MockRepository(); + var fileExporter = mocks.StrictMock(); + mocks.ReplayAll(); + + const string name = "name"; + const string category = "category"; + Bitmap image = new Bitmap(16, 16); + const string fileFilter = "fileFilter"; + + var info = new ExportInfo + { + CreateFileExporter = (data, filePath) => fileExporter, + Name = name, + Category = category, + Image = image, + FileFilter = fileFilter + }; + + // Precondition + Assert.IsInstanceOf>(info); + + // Call + ExportInfo convertedInfo = info; + + // Assert + Assert.IsInstanceOf(convertedInfo); + Assert.AreEqual(typeof(int), convertedInfo.DataType); + Assert.IsNotNull(convertedInfo.CreateFileExporter); + Assert.AreSame(fileExporter, convertedInfo.CreateFileExporter(12, string.Empty)); + Assert.AreEqual(name, info.Name); + Assert.AreEqual(category, info.Category); + Assert.AreSame(image, info.Image); + Assert.AreEqual(fileFilter, info.FileFilter); + + mocks.VerifyAll(); + } + + [Test] + public void ImplicitOperator_NoneOfTheOptionalDelegatesAndPropertiesSet_ExportInfoFullyConverted() + { + // Setup + var info = new ExportInfo(); + + // Precondition + Assert.IsInstanceOf>(info); + + // Call + ExportInfo convertedInfo = info; + + // Assert + Assert.IsInstanceOf(convertedInfo); + Assert.AreEqual(typeof(int), convertedInfo.DataType); + Assert.IsNotNull(convertedInfo.CreateFileExporter); + Assert.IsNull(convertedInfo.CreateFileExporter(new object(), string.Empty)); + Assert.IsNullOrEmpty(info.Name); + Assert.IsNullOrEmpty(info.Category); + Assert.IsNull(info.Image); + Assert.IsNullOrEmpty(info.FileFilter); + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs =================================================================== diff -u -ra32bbe3919b6babd74ae4867e8337662aed0dad2 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs (.../PluginBaseTest.cs) (revision a32bbe3919b6babd74ae4867e8337662aed0dad2) +++ Core/Common/test/Core.Common.Gui.Test/Plugin/PluginBaseTest.cs (.../PluginBaseTest.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -214,7 +214,7 @@ } [Test] - public void GetFileExporters_ReturnsEmptyEnumerable() + public void GetExportInfos_ReturnsEmptyEnumerable() { // Setup var mocks = new MockRepository(); @@ -227,7 +227,7 @@ }) { // Call - var infos = plugin.GetFileExporters(); + var infos = plugin.GetExportInfos(); // Assert CollectionAssert.IsEmpty(infos); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs =================================================================== diff -u -r433ffa13365a07883b2f5bf3a05483b25ff907d3 -rdd84dcabe5561e637e4ade45457437d9c037535b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 433ffa13365a07883b2f5bf3a05483b25ff907d3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b) @@ -84,125 +84,128 @@ // Assert var dynamicPropertyBag = new DynamicPropertyBag(properties); - PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); - Assert.AreEqual(17, dynamicProperties.Count); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(new Attribute[] + { + BrowsableAttribute.Yes + }); + Assert.AreEqual(16, dynamicProperties.Count); var hydraulicDataCategory = "Hydraulische gegevens"; var schematizationCategory = "Schematisatie"; - PropertyDescriptor hydraulicBoundaryLocationProperty = dynamicProperties[1]; + PropertyDescriptor hydraulicBoundaryLocationProperty = dynamicProperties[0]; Assert.IsNotNull(hydraulicBoundaryLocationProperty); Assert.IsFalse(hydraulicBoundaryLocationProperty.IsReadOnly); Assert.AreEqual(hydraulicDataCategory, hydraulicBoundaryLocationProperty.Category); Assert.AreEqual("Locatie met hydraulische randvoorwaarden", hydraulicBoundaryLocationProperty.DisplayName); Assert.AreEqual("De locatie met hydraulische randvoorwaarden waarvan het berekende toetspeil wordt gebruikt.", hydraulicBoundaryLocationProperty.Description); - PropertyDescriptor assessmentLevelProperty = dynamicProperties[2]; + PropertyDescriptor assessmentLevelProperty = dynamicProperties[1]; Assert.IsNotNull(assessmentLevelProperty); Assert.IsTrue(assessmentLevelProperty.IsReadOnly); Assert.AreEqual(hydraulicDataCategory, assessmentLevelProperty.Category); Assert.AreEqual("Toetspeil [m+NAP]", assessmentLevelProperty.DisplayName); Assert.AreEqual("Waterstand met een overschrijdingsfrequentie gelijk aan de trajectnorm.", assessmentLevelProperty.Description); - PropertyDescriptor dampingsFactorExitProperty = dynamicProperties[3]; + PropertyDescriptor dampingsFactorExitProperty = dynamicProperties[2]; Assert.IsNotNull(dampingsFactorExitProperty); Assert.IsInstanceOf(dampingsFactorExitProperty.Converter); Assert.IsFalse(dampingsFactorExitProperty.IsReadOnly); Assert.AreEqual(hydraulicDataCategory, dampingsFactorExitProperty.Category); Assert.AreEqual("Dempingsfactor bij uittredepunt [-]", dampingsFactorExitProperty.DisplayName); Assert.AreEqual("Dempingsfactor relateert respons van stijghoogte bij binnenteen aan buitenwaterstand.", dampingsFactorExitProperty.Description); - PropertyDescriptor phreaticLevelExitProperty = dynamicProperties[4]; + PropertyDescriptor phreaticLevelExitProperty = dynamicProperties[3]; Assert.IsNotNull(phreaticLevelExitProperty); Assert.IsInstanceOf(phreaticLevelExitProperty.Converter); Assert.IsFalse(phreaticLevelExitProperty.IsReadOnly); Assert.AreEqual(hydraulicDataCategory, phreaticLevelExitProperty.Category); Assert.AreEqual("Polderpeil [m+NAP]", phreaticLevelExitProperty.DisplayName); Assert.AreEqual("Polderpeil.", phreaticLevelExitProperty.Description); - PropertyDescriptor surfaceLineProperty = dynamicProperties[5]; + PropertyDescriptor surfaceLineProperty = dynamicProperties[4]; Assert.IsNotNull(surfaceLineProperty); Assert.IsFalse(surfaceLineProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, surfaceLineProperty.Category); Assert.AreEqual("Profielschematisatie", surfaceLineProperty.DisplayName); Assert.AreEqual("De schematisatie van de hoogte van het dwarsprofiel.", surfaceLineProperty.Description); - PropertyDescriptor stochasticSoilModelProperty = dynamicProperties[6]; + PropertyDescriptor stochasticSoilModelProperty = dynamicProperties[5]; Assert.IsNotNull(stochasticSoilModelProperty); Assert.IsFalse(stochasticSoilModelProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, stochasticSoilModelProperty.Category); Assert.AreEqual("Stochastisch ondergrondmodel", stochasticSoilModelProperty.DisplayName); Assert.AreEqual("De verschillende opbouwen van de ondergrond en hun respectieve kansen van voorkomen.", stochasticSoilModelProperty.Description); - PropertyDescriptor stochasticSoilProfileProperty = dynamicProperties[7]; + PropertyDescriptor stochasticSoilProfileProperty = dynamicProperties[6]; Assert.IsNotNull(stochasticSoilProfileProperty); Assert.IsFalse(stochasticSoilProfileProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, stochasticSoilProfileProperty.Category); Assert.AreEqual("Ondergrondschematisatie", stochasticSoilProfileProperty.DisplayName); Assert.AreEqual("De opbouw van de ondergrond.", stochasticSoilProfileProperty.Description); - PropertyDescriptor entryPointLProperty = dynamicProperties[8]; + PropertyDescriptor entryPointLProperty = dynamicProperties[7]; Assert.IsNotNull(entryPointLProperty); Assert.IsFalse(entryPointLProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, entryPointLProperty.Category); Assert.AreEqual("Intredepunt", entryPointLProperty.DisplayName); Assert.AreEqual("De positie in het dwarsprofiel van het intredepunt.", entryPointLProperty.Description); - PropertyDescriptor exitPointLProperty = dynamicProperties[9]; + PropertyDescriptor exitPointLProperty = dynamicProperties[8]; Assert.IsNotNull(exitPointLProperty); Assert.IsFalse(exitPointLProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, exitPointLProperty.Category); Assert.AreEqual("Uittredepunt", exitPointLProperty.DisplayName); Assert.AreEqual("De positie in het dwarsprofiel van het uittredepunt.", exitPointLProperty.Description); - PropertyDescriptor piezometricHeadExitProperty = dynamicProperties[10]; + PropertyDescriptor piezometricHeadExitProperty = dynamicProperties[9]; Assert.IsNotNull(piezometricHeadExitProperty); Assert.IsTrue(piezometricHeadExitProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, piezometricHeadExitProperty.Category); Assert.AreEqual("Stijghoogte bij uittredepunt [m+NAP]", piezometricHeadExitProperty.DisplayName); Assert.AreEqual("Stijghoogte bij uittredepunt.", piezometricHeadExitProperty.Description); - PropertyDescriptor seepageLengthProperty = dynamicProperties[11]; + PropertyDescriptor seepageLengthProperty = dynamicProperties[10]; Assert.IsNotNull(seepageLengthProperty); Assert.IsInstanceOf(seepageLengthProperty.Converter); Assert.IsTrue(seepageLengthProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, seepageLengthProperty.Category); Assert.AreEqual("Kwelweglengte [m]", seepageLengthProperty.DisplayName); Assert.AreEqual("De horizontale afstand tussen intrede- en uittredepunt die het kwelwater ondergronds aflegt voordat het weer aan de oppervlakte komt.", seepageLengthProperty.Description); - PropertyDescriptor thicknessCoverageLayerProperty = dynamicProperties[12]; + PropertyDescriptor thicknessCoverageLayerProperty = dynamicProperties[11]; Assert.IsNotNull(thicknessCoverageLayerProperty); Assert.IsInstanceOf(thicknessCoverageLayerProperty.Converter); Assert.IsTrue(thicknessCoverageLayerProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, thicknessCoverageLayerProperty.Category); Assert.AreEqual("Totale deklaagdikte bij uittredepunt [m]", thicknessCoverageLayerProperty.DisplayName); Assert.AreEqual("Totale deklaagdikte bij uittredepunt.", thicknessCoverageLayerProperty.Description); - PropertyDescriptor thicknessAquiferLayerProperty = dynamicProperties[13]; + PropertyDescriptor thicknessAquiferLayerProperty = dynamicProperties[12]; Assert.IsNotNull(thicknessAquiferLayerProperty); Assert.IsInstanceOf(thicknessAquiferLayerProperty.Converter); Assert.IsTrue(thicknessAquiferLayerProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, thicknessAquiferLayerProperty.Category); Assert.AreEqual("Dikte watervoerend pakket [m]", thicknessAquiferLayerProperty.DisplayName); Assert.AreEqual("De dikte van de bovenste voor doorlatendheid te onderscheiden zandlaag of combinatie van zandlagen.", thicknessAquiferLayerProperty.Description); - PropertyDescriptor darcyPermeabilityProperty = dynamicProperties[14]; + PropertyDescriptor darcyPermeabilityProperty = dynamicProperties[13]; Assert.IsNotNull(darcyPermeabilityProperty); Assert.IsInstanceOf(darcyPermeabilityProperty.Converter); Assert.IsTrue(darcyPermeabilityProperty.IsReadOnly); Assert.AreEqual(schematizationCategory, darcyPermeabilityProperty.Category); Assert.AreEqual("Doorlatendheid aquifer [m/s]", darcyPermeabilityProperty.DisplayName); Assert.AreEqual("Darcy-snelheid waarmee water door de eerste voor doorlatendheid te onderscheiden zandlaag loopt.", darcyPermeabilityProperty.Description); - PropertyDescriptor diameter70Property = dynamicProperties[15]; + PropertyDescriptor diameter70Property = dynamicProperties[14]; Assert.IsNotNull(diameter70Property); Assert.IsInstanceOf(diameter70Property.Converter); Assert.IsTrue(diameter70Property.IsReadOnly); Assert.AreEqual(schematizationCategory, diameter70Property.Category); Assert.AreEqual("70%-fraktiel van de korreldiameter in de bovenste zandlaag [m]", diameter70Property.DisplayName); Assert.AreEqual("Zeefmaat waar 70 gewichtsprocent van de korrels uit een zandlaag doorheen gaat. Hier de korreldiameter van het bovenste gedeelte van de voor doorlatendheid te onderscheiden zandlaag, bepaald zonder fijne fractie (< 63µm).", diameter70Property.Description); - PropertyDescriptor saturatedVolumicWeightOfCoverageLayerProperty = dynamicProperties[16]; + PropertyDescriptor saturatedVolumicWeightOfCoverageLayerProperty = dynamicProperties[15]; Assert.IsNotNull(saturatedVolumicWeightOfCoverageLayerProperty); Assert.IsInstanceOf(saturatedVolumicWeightOfCoverageLayerProperty.Converter); Assert.IsTrue(saturatedVolumicWeightOfCoverageLayerProperty.IsReadOnly);