public void ClearIllustrationPoints_CalculationWithOutputWithIllustrationPoints_ClearsIllustrationPointsAndReturnsTrue() { // Setup var mocks = new MockRepository(); var inquiryHelper = mocks.StrictMock <IInquiryHelper>(); mocks.ReplayAll(); var calculation = new ProbabilisticPipingCalculationScenario { Output = PipingTestDataGenerator.GetRandomProbabilisticPipingOutputWithIllustrationPoints() }; var handler = new ClearIllustrationPointsOfProbabilisticPipingCalculationChangeHandler(inquiryHelper, calculation); // Call bool result = handler.ClearIllustrationPoints(); // Assert Assert.IsTrue(result); Assert.IsNull(((PartialProbabilisticPipingOutput <TestTopLevelIllustrationPoint>)calculation.Output.ProfileSpecificOutput).GeneralResult); Assert.IsNull(((PartialProbabilisticPipingOutput <TestTopLevelIllustrationPoint>)calculation.Output.SectionSpecificOutput).GeneralResult); mocks.VerifyAll(); }
public void Constructor_WithArguments_ExpectedValues() { // Setup var mocks = new MockRepository(); var inquiryHelper = mocks.Stub <IInquiryHelper>(); mocks.ReplayAll(); var calculation = new ProbabilisticPipingCalculationScenario(); // Call var handler = new ClearIllustrationPointsOfProbabilisticPipingCalculationChangeHandler(inquiryHelper, calculation); // Assert Assert.IsInstanceOf <ClearIllustrationPointsOfCalculationChangeHandlerBase <ProbabilisticPipingCalculationScenario> >(handler); mocks.VerifyAll(); }
public void ClearIllustrationPoints_CalculationWithoutOutput_ReturnsFalse() { // Setup var mocks = new MockRepository(); var inquiryHelper = mocks.StrictMock <IInquiryHelper>(); mocks.ReplayAll(); var calculation = new ProbabilisticPipingCalculationScenario(); var handler = new ClearIllustrationPointsOfProbabilisticPipingCalculationChangeHandler(inquiryHelper, calculation); // Call bool result = handler.ClearIllustrationPoints(); // Assert Assert.IsFalse(result); mocks.VerifyAll(); }