public void CreateEffectiveThicknessCalculator_Always_ReturnsEffectiveThicknessCalculator() { // Setup IPipingSubCalculatorFactory factory = PipingSubCalculatorFactory.Instance; // Call IEffectiveThicknessCalculator calculator = factory.CreateEffectiveThicknessCalculator(); // Assert Assert.IsInstanceOf <EffectiveThicknessCalculator>(calculator); }
private IEffectiveThicknessCalculator CreateEffectiveThicknessCalculator() { IEffectiveThicknessCalculator calculator = factory.CreateEffectiveThicknessCalculator(); calculator.SetExitPointXCoordinate(input.ExitPointXCoordinate); calculator.SetPhreaticLevel(input.PhreaticLevelExit); calculator.SetSoilProfile(CreateSoilProfile()); calculator.SetSurfaceLine(CreateSurfaceLine()); calculator.SetVolumicWeightOfWater(input.WaterVolumetricWeight); return(calculator); }
/// <summary> /// Calculates the effective thickness of the coverage layer based on the values of the <see cref="PipingCalculatorInput"/>. /// </summary> /// <returns>The thickness of the coverage layer.</returns> /// <exception cref="PipingCalculatorException">Thrown when: /// <list type="bullet"> /// <item>surface at exit point's x-coordinate is higher than the soil profile</item> /// <item>surface line is <c>null</c></item> /// <item>soil profile is <c>null</c></item> /// <item>soil profile's aquifer layer is not set</item> /// </list></exception> public double CalculateEffectiveThicknessCoverageLayer() { try { IEffectiveThicknessCalculator calculator = CreateEffectiveThicknessCalculator(); calculator.Calculate(); return(calculator.EffectiveHeight); } catch (SoilVolumicMassCalculatorException e) { throw new PipingCalculatorException(e.Message, e); } catch (NullReferenceException e) { throw new PipingCalculatorException(e.Message, e); } }