Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/MacroStabilityKernelOutputToEngineTests.cs =================================================================== diff -u -r6394 -r6398 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/MacroStabilityKernelOutputToEngineTests.cs (.../MacroStabilityKernelOutputToEngineTests.cs) (revision 6394) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/MacroStabilityKernelOutputToEngineTests.cs (.../MacroStabilityKernelOutputToEngineTests.cs) (revision 6398) @@ -54,14 +54,17 @@ CompareOutput(kernelOutput, damEngineOutput); } - private void CompareOutput(FullOutputModelType kernelOutput, MacroStabilityOutput damEngineOutput) + private static void CompareOutput(FullOutputModelType kernelOutput, MacroStabilityOutput damEngineOutput) { - Assert.That(damEngineOutput.StabilityOutputItems[0].CalculationResult, Is.EqualTo(kernelOutput.StabilityOutput.Succeeded ? CalculationResult.Succeeded : CalculationResult.RunFailed)); - Assert.That(damEngineOutput.StabilityOutputItems[0].SafetyFactor, Is.EqualTo(kernelOutput.StabilityOutput.SafetyFactor)); - Assert.That(damEngineOutput.StabilityOutputItems[0].StabilityModelType, Is.EqualTo(OutputConversionHelper.ConvertToStabilityModelType(kernelOutput.StabilityOutput.ModelOption))); + Assert.Multiple(() => + { + Assert.That(damEngineOutput.StabilityOutputItems[0].CalculationResult, Is.EqualTo(kernelOutput.StabilityOutput.Succeeded ? CalculationResult.Succeeded : CalculationResult.RunFailed)); + Assert.That(damEngineOutput.StabilityOutputItems[0].SafetyFactor, Is.EqualTo(kernelOutput.StabilityOutput.SafetyFactor)); + Assert.That(damEngineOutput.StabilityOutputItems[0].StabilityModelType, Is.EqualTo(OutputConversionHelper.ConvertToStabilityModelType(kernelOutput.StabilityOutput.ModelOption))); + }); } - private FullOutputModelType CreateFullOutputModel(StabilityModelOption modelOption) + private static FullOutputModelType CreateFullOutputModel(StabilityModelOption modelOption) { var fullOutputModel = new FullOutputModelType { Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/ObjectRegistryTest.cs =================================================================== diff -u -r6367 -r6398 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/ObjectRegistryTest.cs (.../ObjectRegistryTest.cs) (revision 6367) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIo/ObjectRegistryTest.cs (.../ObjectRegistryTest.cs) (revision 6398) @@ -26,73 +26,69 @@ namespace Deltares.DamEngine.Calculators.Tests.KernelWrappers.MacroStabilityCommon.MacroStabilityIo; [TestFixture] -public class ObjectRegistryTest +public class GivenObjectRegistry { + private static ObjectRegistry objectRegistry; + + [SetUp] + public static void Arrange() + { + objectRegistry = new ObjectRegistry(); + } + + [Test] + public static void WhenGetObjectFromNonExistingIndex_ThenThrowsInvalidOperationException() + { + Assert.That(() => objectRegistry.GetObject(0), Throws.InstanceOf()); + } + + [Test] + public static void WhenGetIdWithoutObject_ThenThrowsArgumentNullException() + { + Assert.That(() => objectRegistry.GetId(null), Throws.ArgumentNullException); + } + [TestFixture] - public class GivenObjectRegistry + public class WhenGetId : GivenObjectRegistry { - private static ObjectRegistry objectRegistry; + private static int index; + private static object @object; [SetUp] - public static void Arrange() + public new static void Arrange() { - objectRegistry = new ObjectRegistry(); + @object = new object(); + index = objectRegistry.GetId(@object); } [Test] - public static void WhenGetObjectFromNonExistingIndex_ThenThrowsInvalidOperationException() + public static void ThenIndexIsZero() { - Assert.That(() => objectRegistry.GetObject(0), Throws.InstanceOf()); + Assert.That(index, Is.Zero); } [Test] - public static void WhenGetIdWithoutObject_ThenThrowsArgumentNullException() + public static void WhenGetObjectUsingReceivedIndex_ThenObjectIsTheSame() { - Assert.That(() => objectRegistry.GetId(null), Throws.ArgumentNullException); + object receivedObject = objectRegistry.GetObject(index); + + Assert.That(receivedObject, Is.SameAs(@object)); } - [TestFixture] - public class WhenGetId : GivenObjectRegistry + [Test] + public static void WhenGetIdFromOtherObject_ThenReturnsIndexIncreasedWithOne() { - private static int index; - private static object @object; + int newIndex = objectRegistry.GetId(new object()); - [SetUp] - public new static void Arrange() - { - @object = new object(); - index = objectRegistry.GetId(@object); - } + Assert.That(newIndex, Is.EqualTo(index + 1)); + } - [Test] - public static void ThenIndexIsZero() - { - Assert.That(index, Is.Zero); - } + [Test] + public static void WhenGetIdFromSameObject_ThenReturnsIndex() + { + int newIndex = objectRegistry.GetId(@object); - [Test] - public static void WhenGetObjectUsingReceivedIndex_ThenObjectIsTheSame() - { - object receivedObject = objectRegistry.GetObject(index); - - Assert.That(receivedObject, Is.SameAs(@object)); - } - - [Test] - public static void WhenGetIdFromOtherObject_ThenReturnsIndexIncreasedWithOne() - { - int newIndex = objectRegistry.GetId(new object()); - - Assert.That(newIndex, Is.EqualTo(index + 1)); - } - - [Test] - public static void WhenGetIdFromSameObject_ThenReturnsIndex() - { - int newIndex = objectRegistry.GetId(@object); - - Assert.That(newIndex, Is.EqualTo(index)); - } + Assert.That(newIndex, Is.EqualTo(index)); } } } \ No newline at end of file