Example #1
0
        public void CompareToThrowsOnNull()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.Throws <ArgumentNullException>(() => decibelvolt.CompareTo(null));
        }
Example #2
0
 public void FromDecibelVolts_WithNanValue_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => AmplitudeRatio.FromDecibelVolts(double.NaN));
 }
Example #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.Throws <ArgumentException>(() => decibelvolt.CompareTo(new object()));
        }
Example #4
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelMillivolts(double?)"/>
 public static AmplitudeRatio?DecibelMillivolts(this double?value) => AmplitudeRatio.FromDecibelMillivolts(value);
Example #5
0
 public void FromDecibelVolts_WithInfinityValue_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => AmplitudeRatio.FromDecibelVolts(double.PositiveInfinity));
     Assert.Throws <ArgumentException>(() => AmplitudeRatio.FromDecibelVolts(double.NegativeInfinity));
 }
Example #6
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelsUnloaded(double?)"/>
 public static AmplitudeRatio?DecibelsUnloaded(this float?value) => AmplitudeRatio.FromDecibelsUnloaded(value);
Example #7
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelMillivolts(double)"/>
 public static AmplitudeRatio DecibelMillivolts(this long value) => AmplitudeRatio.FromDecibelMillivolts(value);
Example #8
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelMicrovolts(double?)"/>
 public static AmplitudeRatio?DecibelMicrovolts(this float?value) => AmplitudeRatio.FromDecibelMicrovolts(value);
Example #9
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelMicrovolts(double)"/>
 public static AmplitudeRatio DecibelMicrovolts(this decimal value) => AmplitudeRatio.FromDecibelMicrovolts(Convert.ToDouble(value));
Example #10
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelVolts(double)"/>
 public static AmplitudeRatio DecibelVolts(this float value) => AmplitudeRatio.FromDecibelVolts(value);
Example #11
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelMicrovolts(double)"/>
 public static AmplitudeRatio DecibelMicrovolts(this double value) => AmplitudeRatio.FromDecibelMicrovolts(value);
Example #12
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelVolts(double?)"/>
 public static AmplitudeRatio?DecibelVolts(this long?value) => AmplitudeRatio.FromDecibelVolts(value);
Example #13
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelsUnloaded(double?)"/>
 public static AmplitudeRatio?DecibelsUnloaded(this decimal?value) => AmplitudeRatio.FromDecibelsUnloaded(value == null ? (double?)null : Convert.ToDouble(value.Value));
Example #14
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelsUnloaded(double)"/>
 public static AmplitudeRatio DecibelsUnloaded(this decimal value) => AmplitudeRatio.FromDecibelsUnloaded(Convert.ToDouble(value));
Example #15
0
        public void EqualsReturnsFalseOnTypeMismatch()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.False(decibelvolt.Equals(new object()));
        }
Example #16
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelMicrovolts(double?)"/>
 public static AmplitudeRatio?DecibelMicrovolts(this decimal?value) => AmplitudeRatio.FromDecibelMicrovolts(value == null ? (double?)null : Convert.ToDouble(value.Value));
Example #17
0
        public void EqualsReturnsFalseOnNull()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.False(decibelvolt.Equals(null));
        }
Example #18
0
 /// <inheritdoc cref="AmplitudeRatio.FromDecibelsUnloaded(double)"/>
 public static AmplitudeRatio DecibelsUnloaded(this double value) => AmplitudeRatio.FromDecibelsUnloaded(value);