Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/Helpers/ConfigurationAssessmentSectionCategoryTypeConverter.cs =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/Helpers/ConfigurationAssessmentSectionCategoryTypeConverter.cs (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/Helpers/ConfigurationAssessmentSectionCategoryTypeConverter.cs (revision 4526f192889d12b19032d94756c353f34723637f) @@ -0,0 +1,40 @@ +// Copyright (C) Stichting Deltares 2017. 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.ComponentModel; +using Ringtoets.Common.Data.AssessmentSection; + +namespace Ringtoets.Revetment.IO.Configurations.Helpers +{ + /// + /// Converts to and back. + /// + public class ConfigurationAssessmentSectionCategoryTypeConverter : TypeConverter + { + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof(string) + || sourceType == typeof(AssessmentSectionCategoryType) + || base.CanConvertFrom(context, sourceType); + } + } +} \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj =================================================================== diff -u -r9334a722eef30e019e2e5947101c876d231e2c6b -r4526f192889d12b19032d94756c353f34723637f --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj (.../Ringtoets.Revetment.IO.csproj) (revision 9334a722eef30e019e2e5947101c876d231e2c6b) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj (.../Ringtoets.Revetment.IO.csproj) (revision 4526f192889d12b19032d94756c353f34723637f) @@ -25,6 +25,7 @@ + Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/Helpers/ConfigurationAssessmentSectionCategoryTypeConverterTest.cs =================================================================== diff -u --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/Helpers/ConfigurationAssessmentSectionCategoryTypeConverterTest.cs (revision 0) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/Helpers/ConfigurationAssessmentSectionCategoryTypeConverterTest.cs (revision 4526f192889d12b19032d94756c353f34723637f) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2017. 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.ComponentModel; +using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Revetment.IO.Configurations.Helpers; + +namespace Ringtoets.Revetment.IO.Test.Configurations.Helpers +{ + [TestFixture] + public class ConfigurationAssessmentSectionCategoryTypeConverterTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var converter = new ConfigurationAssessmentSectionCategoryTypeConverter(); + + // Assert + Assert.IsInstanceOf(converter); + } + + [Test] + public void CanConvertFrom_AssessmentSectionCategoryType_ReturnTrue() + { + // Setup + var converter = new ConfigurationAssessmentSectionCategoryTypeConverter(); + + // Call + bool canConvertFrom = converter.CanConvertFrom(typeof(AssessmentSectionCategoryType)); + + // Assert + Assert.IsTrue(canConvertFrom); + } + + [Test] + public void CanConvertFrom_OtherType_ReturnFalse() + { + // Setup + var converter = new ConfigurationAssessmentSectionCategoryTypeConverter(); + + // Call + bool canConvertFrom = converter.CanConvertFrom(typeof(object)); + + // Assert + Assert.IsFalse(canConvertFrom); + } + } +} \ No newline at end of file Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Ringtoets.Revetment.IO.Test.csproj =================================================================== diff -u -r9334a722eef30e019e2e5947101c876d231e2c6b -r4526f192889d12b19032d94756c353f34723637f --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Ringtoets.Revetment.IO.Test.csproj (.../Ringtoets.Revetment.IO.Test.csproj) (revision 9334a722eef30e019e2e5947101c876d231e2c6b) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Ringtoets.Revetment.IO.Test.csproj (.../Ringtoets.Revetment.IO.Test.csproj) (revision 4526f192889d12b19032d94756c353f34723637f) @@ -24,6 +24,7 @@ +