コード例 #1
0
        public void CompareToThrowsOnNull()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

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

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

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

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