public void TestGeneratedConversions() { var d = new Quantities.Length(1, Units.Mile); var t = new Quantities.Time(1, Units.Minute); var v = d / t; Assert.IsAssignableFrom <Quantity <Velocity> >(v); Assert.Equal(60, v.In(Units.MilesPerHour)); }
/// <summary> /// Handles the calculation. /// </summary> /// <param name="wallMaterial">The material that the wall is made out of.</param> /// <param name="radius">The radius of the pool.</param> /// <param name="outputUnitOfMeasure">The unit of measure that the output value should be formatted in.</param> /// <returns></returns> public static decimal CalculateMaximumWaterDepth(IWallMaterial wallMaterial, Length radius, Quantities.Length outputUnitOfMeasure = Quantities.Length.Meter) { var maximumInternalPressureWallCanWithstand = GetMaximumInternalPressureWallCanWithstand(wallMaterial); var internalPressure = GetInternalPressure(radius); var maximumWaterDepthInMeters = maximumInternalPressureWallCanWithstand / internalPressure; var convertedMaximumWaterDepth = MeterConverter.FromMetersTo(maximumWaterDepthInMeters, outputUnitOfMeasure); return(convertedMaximumWaterDepth); }
/// <summary> /// Setter. /// </summary> /// <param name="unitOfMeasure">A SI unit that will measure the quantity of Length.</param> /// <returns></returns> public Builder UnitOfMeasure(Quantities.Length unitOfMeasure) { Length.UnitOfMeasure = unitOfMeasure; return(this); }