Fisheye: Tag 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0 refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/AssemblyCategoryAssert.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs =================================================================== diff -u -r32b6141230e0bab9452aadb77760734ae5f4da9c -r0c8ff298db78d2860268b9d951ed8e4a1b7d78d0 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs (.../AssemblyCategoriesCalculatorTest.cs) (revision 32b6141230e0bab9452aadb77760734ae5f4da9c) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs (.../AssemblyCategoriesCalculatorTest.cs) (revision 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0) @@ -29,6 +29,7 @@ using Rhino.Mocks; using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Categories; using Ringtoets.AssemblyTool.KernelWrapper.Kernels; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Kernels; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Kernels.Categories; using Ringtoets.Common.Data.AssemblyTool; Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/AssemblyCategoryCreatorTest.cs =================================================================== diff -u -r7b5c9aa3a65821c1b219ba3ef2c99830c1e25d8a -r0c8ff298db78d2860268b9d951ed8e4a1b7d78d0 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/AssemblyCategoryCreatorTest.cs (.../AssemblyCategoryCreatorTest.cs) (revision 7b5c9aa3a65821c1b219ba3ef2c99830c1e25d8a) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/AssemblyCategoryCreatorTest.cs (.../AssemblyCategoryCreatorTest.cs) (revision 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0) @@ -29,6 +29,7 @@ using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.AssemblyTool.KernelWrapper.Creators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil; using Ringtoets.Common.Data.AssemblyTool; namespace Ringtoets.AssemblyTool.KernelWrapper.Test.Creators Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Ringtoets.AssemblyTool.KernelWrapper.Test.csproj =================================================================== diff -u -r78a2d68d97b329b4c1309349a564b6a52448accd -r0c8ff298db78d2860268b9d951ed8e4a1b7d78d0 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Ringtoets.AssemblyTool.KernelWrapper.Test.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.Test.csproj) (revision 78a2d68d97b329b4c1309349a564b6a52448accd) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Ringtoets.AssemblyTool.KernelWrapper.Test.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.Test.csproj) (revision 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0) @@ -20,7 +20,6 @@ - Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/AssemblyCategoryAssert.cs =================================================================== diff -u --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/AssemblyCategoryAssert.cs (revision 0) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/AssemblyCategoryAssert.cs (revision 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0) @@ -0,0 +1,117 @@ +// 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.Collections.Generic; +using System.Linq; +using AssemblyTool.Kernel; +using AssemblyTool.Kernel.Data.AssemblyCategories; +using NUnit.Framework; +using Ringtoets.Common.Data.AssemblyTool; + +namespace Ringtoets.AssemblyTool.KernelWrapper.TestUtil +{ + /// + /// Class for asserting categories result. + /// + public static class AssemblyCategoryAssert + { + /// + /// Asserts whether is equal to . + /// + /// The original . + /// The actual . + /// Thrown when + /// is not equal to . + public static void AssertAssessmentSectionAssemblyCategories(CalculationOutput original, + IEnumerable actual) + { + Assert.AreEqual(original.Result.Length, actual.Count()); + + CollectionAssert.AreEqual(original.Result.Select(o => GetAssessmentSectionCategoryGroup(o.CategoryGroup)), actual.Select(r => r.Group)); + CollectionAssert.AreEqual(original.Result.Select(o => o.LowerBoundary), actual.Select(r => r.LowerBoundary)); + CollectionAssert.AreEqual(original.Result.Select(o => o.UpperBoundary), actual.Select(r => r.UpperBoundary)); + } + + /// + /// Asserts whether is equal to . + /// + /// The original . + /// The actual . + /// Thrown when + /// is not equal to . + public static void AssertFailureMechanismSectionAssemblyCategories(CalculationOutput original, + IEnumerable actual) + { + Assert.AreEqual(original.Result.Length, actual.Count()); + + CollectionAssert.AreEqual(original.Result.Select(o => GetFailureMechanismSectionCategoryGroup(o.CategoryGroup)), actual.Select(r => r.Group)); + CollectionAssert.AreEqual(original.Result.Select(o => o.LowerBoundary), actual.Select(r => r.LowerBoundary)); + CollectionAssert.AreEqual(original.Result.Select(o => o.UpperBoundary), actual.Select(r => r.UpperBoundary)); + } + + private static AssessmentSectionAssemblyCategoryGroup GetAssessmentSectionCategoryGroup(AssessmentSectionCategoryGroup category) + { + switch (category) + { + case AssessmentSectionCategoryGroup.APlus: + return AssessmentSectionAssemblyCategoryGroup.APlus; + case AssessmentSectionCategoryGroup.A: + return AssessmentSectionAssemblyCategoryGroup.A; + case AssessmentSectionCategoryGroup.B: + return AssessmentSectionAssemblyCategoryGroup.B; + case AssessmentSectionCategoryGroup.C: + return AssessmentSectionAssemblyCategoryGroup.C; + case AssessmentSectionCategoryGroup.D: + return AssessmentSectionAssemblyCategoryGroup.D; + default: + throw new NotSupportedException(); + } + } + + private static FailureMechanismSectionAssemblyCategoryGroup GetFailureMechanismSectionCategoryGroup(FailureMechanismSectionCategoryGroup category) + { + switch (category) + { + case FailureMechanismSectionCategoryGroup.Iv: + return FailureMechanismSectionAssemblyCategoryGroup.Iv; + case FailureMechanismSectionCategoryGroup.IIv: + return FailureMechanismSectionAssemblyCategoryGroup.IIv; + case FailureMechanismSectionCategoryGroup.IIIv: + return FailureMechanismSectionAssemblyCategoryGroup.IIIv; + case FailureMechanismSectionCategoryGroup.IVv: + return FailureMechanismSectionAssemblyCategoryGroup.IVv; + case FailureMechanismSectionCategoryGroup.Vv: + return FailureMechanismSectionAssemblyCategoryGroup.Vv; + case FailureMechanismSectionCategoryGroup.VIv: + return FailureMechanismSectionAssemblyCategoryGroup.VIv; + case FailureMechanismSectionCategoryGroup.VIIv: + return FailureMechanismSectionAssemblyCategoryGroup.VIIv; + case FailureMechanismSectionCategoryGroup.NotApplicable: + return FailureMechanismSectionAssemblyCategoryGroup.NotApplicable; + case FailureMechanismSectionCategoryGroup.None: + return FailureMechanismSectionAssemblyCategoryGroup.None; + default: + throw new NotSupportedException(); + } + } + } +} \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.csproj =================================================================== diff -u -r39e13825618c9845e2100ae802a007c04c2e8517 -r0c8ff298db78d2860268b9d951ed8e4a1b7d78d0 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.TestUtil.csproj) (revision 39e13825618c9845e2100ae802a007c04c2e8517) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.TestUtil.csproj) (revision 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0) @@ -11,10 +11,14 @@ False ..\..\..\..\lib\Plugins\AssemblyTool\AssemblyToolKernel.dll + + ..\..\..\..\packages\NUnit.3.8.1\lib\net40\nunit.framework.dll + + @@ -29,6 +33,7 @@ Copying.licenseheader + Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/packages.config =================================================================== diff -u --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/packages.config (revision 0) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/packages.config (revision 0c8ff298db78d2860268b9d951ed8e4a1b7d78d0) @@ -0,0 +1,25 @@ + + + + \ No newline at end of file