예제 #1
0
        public void CompareToIsImplemented()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.AreEqual(0, decibelvolt.CompareTo(decibelvolt));
            Assert.Greater(decibelvolt.CompareTo(AmplitudeRatio.Zero), 0);
            Assert.Less(AmplitudeRatio.Zero.CompareTo(decibelvolt), 0);
        }
예제 #2
0
        public void CompareToIsImplemented()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.Equal(0, decibelvolt.CompareTo(decibelvolt));
            Assert.True(decibelvolt.CompareTo(AmplitudeRatio.Zero) > 0);
            Assert.True(AmplitudeRatio.Zero.CompareTo(decibelvolt) < 0);
        }
예제 #3
0
        public void CompareToThrowsOnNull()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            decibelvolt.CompareTo(null);
        }
예제 #4
0
        public void CompareToThrowsOnTypeMismatch()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            decibelvolt.CompareTo(new object());
        }
예제 #5
0
        public void CompareToThrowsOnNull()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.Throws <ArgumentNullException>(() => decibelvolt.CompareTo(null));
        }
예제 #6
0
        public void CompareToThrowsOnTypeMismatch()
        {
            AmplitudeRatio decibelvolt = AmplitudeRatio.FromDecibelVolts(1);

            Assert.Throws <ArgumentException>(() => decibelvolt.CompareTo(new object()));
        }