private static void AddEntityForMacroStabilityInwardsOutput(MacroStabilityInwardsCalculationEntity entity, MacroStabilityInwardsOutput output) { if (output != null) { entity.MacroStabilityInwardsCalculationOutputEntities.Add(output.Create()); } }
public void Create_WithNaNValues_ReturnsPropertyWithExpectedPropertiesSet() { // Setup MacroStabilityInwardsSlidingCircle leftCircle = CreateSlidingCircleWithNaNValues(); MacroStabilityInwardsSlidingCircle rightCircle = CreateSlidingCircleWithNaNValues(); var slidingCurve = new MacroStabilityInwardsSlidingCurve(leftCircle, rightCircle, new MacroStabilityInwardsSlice[0], double.NaN, double.NaN); var slipPlane = new MacroStabilityInwardsSlipPlaneUpliftVan(CreateGridWithNaNValues(), CreateGridWithNaNValues(), new RoundedDouble[0]); var output = new MacroStabilityInwardsOutput(slidingCurve, slipPlane, new MacroStabilityInwardsOutput.ConstructionProperties()); // Call MacroStabilityInwardsCalculationOutputEntity entity = output.Create(); // Assert Assert.IsNotNull(entity); Assert.IsNull(entity.FactorOfStability); Assert.IsNull(entity.ForbiddenZonesXEntryMin); Assert.IsNull(entity.ForbiddenZonesXEntryMax); Assert.IsNull(entity.SlipPlaneLeftGridXLeft); Assert.IsNull(entity.SlipPlaneLeftGridXRight); Assert.IsNull(entity.SlipPlaneLeftGridZTop); Assert.IsNull(entity.SlipPlaneLeftGridZBottom); Assert.IsNull(entity.SlipPlaneRightGridXLeft); Assert.IsNull(entity.SlipPlaneRightGridXRight); Assert.IsNull(entity.SlipPlaneRightGridZTop); Assert.IsNull(entity.SlipPlaneRightGridZBottom); Assert.IsNull(entity.SlidingCurveIteratedHorizontalForce); Assert.IsNull(entity.SlidingCurveNonIteratedHorizontalForce); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleCenterX); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleCenterY); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleRadius); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleIteratedForce); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleNonIteratedForce); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleDrivingMoment); Assert.IsNull(entity.SlidingCurveLeftSlidingCircleResistingMoment); Assert.IsNull(entity.SlidingCurveRightSlidingCircleCenterX); Assert.IsNull(entity.SlidingCurveRightSlidingCircleCenterY); Assert.IsNull(entity.SlidingCurveRightSlidingCircleRadius); Assert.IsNull(entity.SlidingCurveRightSlidingCircleIteratedForce); Assert.IsNull(entity.SlidingCurveRightSlidingCircleNonIteratedForce); Assert.IsNull(entity.SlidingCurveRightSlidingCircleDrivingMoment); Assert.IsNull(entity.SlidingCurveRightSlidingCircleResistingMoment); }
public void Create_WithValidValues_ReturnsEntityWithExpectedPropertiesSet() { // Setup var random = new Random(21); MacroStabilityInwardsSlidingCircle leftCircle = CreateSlidingCircle(13); MacroStabilityInwardsSlidingCircle rightCircle = CreateSlidingCircle(34); IEnumerable<MacroStabilityInwardsSlice> slices = new[] { MacroStabilityInwardsSliceTestFactory.CreateSlice() }; var slidingCurve = new MacroStabilityInwardsSlidingCurve(leftCircle, rightCircle, slices, random.NextDouble(), random.NextDouble()); MacroStabilityInwardsGrid leftGrid = MacroStabilityInwardsGridTestFactory.Create(); MacroStabilityInwardsGrid rightGrid = MacroStabilityInwardsGridTestFactory.Create(); RoundedDouble[] tangentLines = { random.NextRoundedDouble() }; var slipPlane = new MacroStabilityInwardsSlipPlaneUpliftVan(leftGrid, rightGrid, tangentLines); var output = new MacroStabilityInwardsOutput(slidingCurve, slipPlane, new MacroStabilityInwardsOutput.ConstructionProperties { FactorOfStability = random.NextDouble(), ForbiddenZonesXEntryMax = random.NextDouble(), ForbiddenZonesXEntryMin = random.NextDouble() }); // Call MacroStabilityInwardsCalculationOutputEntity entity = output.Create(); // Assert Assert.IsNotNull(entity); MacroStabilityInwardsCalculationOutputEntityTestHelper.AssertOutputPropertyValues(output, entity); }