Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableFailureMechanismCategoryGroupCreatorTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableFailureMechanismCategoryGroupCreatorTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableFailureMechanismCategoryGroupCreatorTest.cs (revision 1c96cd96d2dc97f661604e627f31b47ab4c8e547) @@ -0,0 +1,79 @@ +// 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 Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.AssemblyTool.IO.Model.Enums; +using Ringtoets.Integration.IO.Creators; + +namespace Ringtoets.Integration.IO.Test.Creators +{ + [TestFixture] + public class SerializableFailureMechanismCategoryGroupCreatorTest + { + [Test] + public void Create_InvalidFailureMechanismAssemblyCategoryGroup_ThrowInvalidEnumArgumentException() + { + // Setup + const FailureMechanismAssemblyCategoryGroup groupInput = (FailureMechanismAssemblyCategoryGroup) 999; + + // Call + TestDelegate call = () => SerializableFailureMechanismCategoryGroupCreator.Create(groupInput); + + // Assert + string message = $"The value of argument 'categoryGroup' ({(int) groupInput}) is invalid for Enum type '{nameof(FailureMechanismAssemblyCategoryGroup)}'."; + var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); + Assert.AreEqual("categoryGroup", exception.ParamName); + } + + [Test] + public void Create_WithFailureMechanismCategoryGroupNone_ThrowsNotSupportedException() + { + // Call + TestDelegate call = () => SerializableFailureMechanismCategoryGroupCreator.Create(FailureMechanismAssemblyCategoryGroup.None); + + // Assert + Assert.Throws(call); + } + + [Test] + [TestCase(FailureMechanismAssemblyCategoryGroup.NotApplicable, SerializableFailureMechanismCategoryGroup.NotApplicable)] + [TestCase(FailureMechanismAssemblyCategoryGroup.It, SerializableFailureMechanismCategoryGroup.It)] + [TestCase(FailureMechanismAssemblyCategoryGroup.IIt, SerializableFailureMechanismCategoryGroup.IIt)] + [TestCase(FailureMechanismAssemblyCategoryGroup.IIIt, SerializableFailureMechanismCategoryGroup.IIIt)] + [TestCase(FailureMechanismAssemblyCategoryGroup.IVt, SerializableFailureMechanismCategoryGroup.IVt)] + [TestCase(FailureMechanismAssemblyCategoryGroup.Vt, SerializableFailureMechanismCategoryGroup.Vt)] + [TestCase(FailureMechanismAssemblyCategoryGroup.VIt, SerializableFailureMechanismCategoryGroup.VIt)] + [TestCase(FailureMechanismAssemblyCategoryGroup.VIIt, SerializableFailureMechanismCategoryGroup.VIIt)] + public void Create_WithFailureMechanismCategoryGroup_ReturnsExpectedValues(FailureMechanismAssemblyCategoryGroup categoryGroup, + SerializableFailureMechanismCategoryGroup expectedGroup) + { + // Call + SerializableFailureMechanismCategoryGroup serializableGroup = SerializableFailureMechanismCategoryGroupCreator.Create(categoryGroup); + + // Assert + Assert.AreEqual(expectedGroup, serializableGroup); + } + } +} \ No newline at end of file Fisheye: Tag 1c96cd96d2dc97f661604e627f31b47ab4c8e547 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableFailureMechanismGroupCreatorTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj =================================================================== diff -u -r66867c059a3d1c4846828871cdf6d354b2b608a6 -r1c96cd96d2dc97f661604e627f31b47ab4c8e547 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision 66867c059a3d1c4846828871cdf6d354b2b608a6) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision 1c96cd96d2dc97f661604e627f31b47ab4c8e547) @@ -41,7 +41,7 @@ - +