Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestCalculationWithForeshoreProfileTest.cs =================================================================== diff -u -r38bc3bb60b50bdfb98f76be1e03f6d663733008d -rb046a5ad0ed9a756aea88e9c0ad543bf657877f9 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestCalculationWithForeshoreProfileTest.cs (.../TestCalculationWithForeshoreProfileTest.cs) (revision 38bc3bb60b50bdfb98f76be1e03f6d663733008d) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestCalculationWithForeshoreProfileTest.cs (.../TestCalculationWithForeshoreProfileTest.cs) (revision b046a5ad0ed9a756aea88e9c0ad543bf657877f9) @@ -40,24 +40,18 @@ } [Test] - public void CreateCalculationWithOutput_ForeshoreProfileNull_ReturnsExpectedValues() + [TestCase(true)] + [TestCase(false)] + public void CreateCalculationWithOutput_WithOrWithoutForeshoreProfile_ReturnsExpectedValues(bool hasForeshoreProfile) { - // Call - TestCalculationWithForeshoreProfile calculation = - TestCalculationWithForeshoreProfile.CreateCalculationWithOutput(null); - - // Assert - Assert.IsTrue(calculation.HasOutput); - Assert.IsNull(calculation.InputParameters.ForeshoreProfile); - Assert.IsNull(calculation.Comments); - } - - [Test] - public void CreateCalculationWithOutput_WithForeshoreProfile_ReturnsExpectedValues() - { // Setup - var foreshoreProfile = new TestForeshoreProfile(); + TestForeshoreProfile foreshoreProfile = null; + if (hasForeshoreProfile) + { + foreshoreProfile = new TestForeshoreProfile(); + } + // Call TestCalculationWithForeshoreProfile calculation = TestCalculationWithForeshoreProfile.CreateCalculationWithOutput(foreshoreProfile); @@ -69,11 +63,18 @@ } [Test] - public void CreateCalculationWithoutOutput_WithForeshoreProfile_ReturnsExpectedValues() + [TestCase(true)] + [TestCase(false)] + public void CreateCalculationWithoutOutput_WithOrWithoutForeshoreProfile_ReturnsExpectedValues(bool hasForeshoreProfile) { // Setup - var foreshoreProfile = new TestForeshoreProfile(); + TestForeshoreProfile foreshoreProfile = null; + if (hasForeshoreProfile) + { + foreshoreProfile = new TestForeshoreProfile(); + } + // Call TestCalculationWithForeshoreProfile calculation = TestCalculationWithForeshoreProfile.CreateCalculationWithoutOutput(foreshoreProfile); @@ -85,19 +86,6 @@ } [Test] - public void CreateCalculationWithoutOutput_ForeshoreProfileNull_ReturnsExpectedValues() - { - // Call - TestCalculationWithForeshoreProfile calculation = - TestCalculationWithForeshoreProfile.CreateCalculationWithoutOutput(null); - - // Assert - Assert.IsFalse(calculation.HasOutput); - Assert.IsNull(calculation.InputParameters.ForeshoreProfile); - Assert.IsNull(calculation.Comments); - } - - [Test] public void ClearOutput_CalculationWithOutput_OutputClear() { // Setup @@ -113,17 +101,18 @@ } [Test] - public void ClearOutput_WithoutOutput_OutputClear() + public void ClearOutput_WithoutOutput_DoesNotThrow() { // Setup var foreshoreProfile = new TestForeshoreProfile(); TestCalculationWithForeshoreProfile calculation = TestCalculationWithForeshoreProfile.CreateCalculationWithoutOutput(foreshoreProfile); // Call - calculation.ClearOutput(); + TestDelegate test = () => calculation.ClearOutput(); // Assert + Assert.DoesNotThrow(test); Assert.IsFalse(calculation.HasOutput); } }