예제 #1
0
        public void Absolute_WithAbsolutePressureReference_IsEqual()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Absolute);

            AssertEx.EqualTolerance(3, refPressure.Absolute.Atmospheres, AtmospheresTolerance);
        }
예제 #2
0
 public static Pressure?Atmospheres <T>(this T?value) where T : struct => Pressure.FromAtmospheres(value == null ? (double?)null : Convert.ToDouble(value.Value));
예제 #3
0
 public void NumberToAtmospheresTest() =>
 Assert.Equal(Pressure.FromAtmospheres(2), 2.Atmospheres());
예제 #4
0
        public void Vacuum_WithVacuumPressureReference_IsEqual()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(1), PressureReference.Vacuum);

            AssertEx.EqualTolerance(1, refPressure.Vacuum.Atmospheres, AtmospheresTolerance);
        }
예제 #5
0
 /// <inheritdoc cref="Pressure.FromAtmospheres(UnitsNet.QuantityValue)" />
 public static Pressure Atmospheres <T>(this T value) => Pressure.FromAtmospheres(Convert.ToDouble(value));
예제 #6
0
        public void Vacuum_WithDefaultPressureReference_IsOneLessAtmosphereNegative()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3));

            AssertEx.EqualTolerance(-2, refPressure.Vacuum.Atmospheres, AtmospheresTolerance);
        }
예제 #7
0
        public void Vacuum_WithGaugePressureReference_IsNegative()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Gauge);

            AssertEx.EqualTolerance(-3, refPressure.Vacuum.Atmospheres, AtmospheresTolerance);
        }
예제 #8
0
        public void Gauge_WithVacuumPressureReference_ThrowsArgumentOutOfRangeException()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Vacuum);

            Assert.Throws <ArgumentOutOfRangeException>(() => refPressure.Gauge.Atmospheres);
        }
예제 #9
0
        public void Reference_WithDefaultPressureReference_IsAbsolute()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3));

            Equals(PressureReference.Absolute, refPressure.Reference);
        }
예제 #10
0
        public void Gauge_WithVacuumPressureReference_IsNegative()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(1), PressureReference.Vacuum);

            AssertEx.EqualTolerance(-1, refPressure.Gauge.Atmospheres, AtmospheresTolerance);
        }
예제 #11
0
        public void Gauge_WithDefaultPressureReference_IsOneLessAtmosphere()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3));

            AssertEx.EqualTolerance(2, refPressure.Gauge.Atmospheres, AtmospheresTolerance);
        }
예제 #12
0
        public void Absolute_WithVacuumPressureReference_IsOneLessAtmosphereNegative()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(1), PressureReference.Vacuum);

            AssertEx.EqualTolerance(0, refPressure.Absolute.Atmospheres, AtmospheresTolerance);
        }
예제 #13
0
        public void Absolute_WithNegativeGaugePressureReference_ThrowsArgumentOutOfRangeException()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(-3), PressureReference.Gauge);

            Assert.Throws <ArgumentOutOfRangeException>(() => refPressure.Absolute.Atmospheres);
        }
예제 #14
0
        public void Absolute_WithGaugePressureReference_IsOneMore()
        {
            var refPressure = new ReferencePressure(Pressure.FromAtmospheres(3), PressureReference.Gauge);

            AssertEx.EqualTolerance(4, refPressure.Absolute.Atmospheres, AtmospheresTolerance);
        }