@@ -38,11 +38,13 @@ public abstract partial class AmplitudeRatioTestsBase
38
38
{
39
39
protected abstract double DecibelMicrovoltsInOneDecibelVolt { get ; }
40
40
protected abstract double DecibelMillivoltsInOneDecibelVolt { get ; }
41
+ protected abstract double DecibelsUnloadedInOneDecibelVolt { get ; }
41
42
protected abstract double DecibelVoltsInOneDecibelVolt { get ; }
42
43
43
44
// ReSharper disable VirtualMemberNeverOverriden.Global
44
45
protected virtual double DecibelMicrovoltsTolerance { get { return 1e-5 ; } }
45
46
protected virtual double DecibelMillivoltsTolerance { get { return 1e-5 ; } }
47
+ protected virtual double DecibelsUnloadedTolerance { get { return 1e-5 ; } }
46
48
protected virtual double DecibelVoltsTolerance { get { return 1e-5 ; } }
47
49
// ReSharper restore VirtualMemberNeverOverriden.Global
48
50
@@ -52,6 +54,7 @@ public void DecibelVoltToAmplitudeRatioUnits()
52
54
AmplitudeRatio decibelvolt = AmplitudeRatio . FromDecibelVolts ( 1 ) ;
53
55
Assert . AreEqual ( DecibelMicrovoltsInOneDecibelVolt , decibelvolt . DecibelMicrovolts , DecibelMicrovoltsTolerance ) ;
54
56
Assert . AreEqual ( DecibelMillivoltsInOneDecibelVolt , decibelvolt . DecibelMillivolts , DecibelMillivoltsTolerance ) ;
57
+ Assert . AreEqual ( DecibelsUnloadedInOneDecibelVolt , decibelvolt . DecibelsUnloaded , DecibelsUnloadedTolerance ) ;
55
58
Assert . AreEqual ( DecibelVoltsInOneDecibelVolt , decibelvolt . DecibelVolts , DecibelVoltsTolerance ) ;
56
59
}
57
60
@@ -60,6 +63,7 @@ public void FromValueAndUnit()
60
63
{
61
64
Assert . AreEqual ( 1 , AmplitudeRatio . From ( 1 , AmplitudeRatioUnit . DecibelMicrovolt ) . DecibelMicrovolts , DecibelMicrovoltsTolerance ) ;
62
65
Assert . AreEqual ( 1 , AmplitudeRatio . From ( 1 , AmplitudeRatioUnit . DecibelMillivolt ) . DecibelMillivolts , DecibelMillivoltsTolerance ) ;
66
+ Assert . AreEqual ( 1 , AmplitudeRatio . From ( 1 , AmplitudeRatioUnit . DecibelUnloaded ) . DecibelsUnloaded , DecibelsUnloadedTolerance ) ;
63
67
Assert . AreEqual ( 1 , AmplitudeRatio . From ( 1 , AmplitudeRatioUnit . DecibelVolt ) . DecibelVolts , DecibelVoltsTolerance ) ;
64
68
}
65
69
@@ -69,6 +73,7 @@ public void As()
69
73
var decibelvolt = AmplitudeRatio . FromDecibelVolts ( 1 ) ;
70
74
Assert . AreEqual ( DecibelMicrovoltsInOneDecibelVolt , decibelvolt . As ( AmplitudeRatioUnit . DecibelMicrovolt ) , DecibelMicrovoltsTolerance ) ;
71
75
Assert . AreEqual ( DecibelMillivoltsInOneDecibelVolt , decibelvolt . As ( AmplitudeRatioUnit . DecibelMillivolt ) , DecibelMillivoltsTolerance ) ;
76
+ Assert . AreEqual ( DecibelsUnloadedInOneDecibelVolt , decibelvolt . As ( AmplitudeRatioUnit . DecibelUnloaded ) , DecibelsUnloadedTolerance ) ;
72
77
Assert . AreEqual ( DecibelVoltsInOneDecibelVolt , decibelvolt . As ( AmplitudeRatioUnit . DecibelVolt ) , DecibelVoltsTolerance ) ;
73
78
}
74
79
@@ -78,6 +83,7 @@ public void ConversionRoundTrip()
78
83
AmplitudeRatio decibelvolt = AmplitudeRatio . FromDecibelVolts ( 1 ) ;
79
84
Assert . AreEqual ( 1 , AmplitudeRatio . FromDecibelMicrovolts ( decibelvolt . DecibelMicrovolts ) . DecibelVolts , DecibelMicrovoltsTolerance ) ;
80
85
Assert . AreEqual ( 1 , AmplitudeRatio . FromDecibelMillivolts ( decibelvolt . DecibelMillivolts ) . DecibelVolts , DecibelMillivoltsTolerance ) ;
86
+ Assert . AreEqual ( 1 , AmplitudeRatio . FromDecibelsUnloaded ( decibelvolt . DecibelsUnloaded ) . DecibelVolts , DecibelsUnloadedTolerance ) ;
81
87
Assert . AreEqual ( 1 , AmplitudeRatio . FromDecibelVolts ( decibelvolt . DecibelVolts ) . DecibelVolts , DecibelVoltsTolerance ) ;
82
88
}
83
89
0 commit comments