public void GetNormativeHydraulicBoundaryLocationCalculation_NoCorrespondingCalculation_ReturnsNull() { // Setup var random = new Random(21); var assessmentSection = new AssessmentSectionStub { FailureMechanismContribution = { NormativeProbabilityType = random.NextEnumValue <NormativeProbabilityType>() } }; // Call HydraulicBoundaryLocationCalculation hydraulicBoundaryLocationCalculation = assessmentSection.GetNormativeHydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); // Assert Assert.IsNull(hydraulicBoundaryLocationCalculation); }
public void GetNormativeHydraulicBoundaryLocationCalculation_AssessmentSectionWithInvalidNormativeProbabilityType_ThrowsInvalidEnumArgumentException() { // Setup const int invalidValue = 9999; var assessmentSection = new AssessmentSectionStub { FailureMechanismContribution = { NormativeProbabilityType = (NormativeProbabilityType)invalidValue } }; // Call void Call() => assessmentSection.GetNormativeHydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); // Assert var expectedMessage = $"The value of argument 'normativeProbabilityType' ({invalidValue}) is invalid for Enum type '{nameof(NormativeProbabilityType)}'."; string parameterName = TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(Call, expectedMessage).ParamName; Assert.AreEqual("normativeProbabilityType", parameterName); }