public void CompareToIsImplemented()
        {
            ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1);

            Assert.AreEqual(0, voltac.CompareTo(voltac));
            Assert.Greater(voltac.CompareTo(ElectricPotentialAc.Zero), 0);
            Assert.Less(ElectricPotentialAc.Zero.CompareTo(voltac), 0);
        }
示例#2
0
        public void CompareToIsImplemented()
        {
            ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1);

            Assert.Equal(0, voltac.CompareTo(voltac));
            Assert.True(voltac.CompareTo(ElectricPotentialAc.Zero) > 0);
            Assert.True(ElectricPotentialAc.Zero.CompareTo(voltac) < 0);
        }
        public void CompareToThrowsOnNull()
        {
            ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            voltac.CompareTo(null);
        }
        public void CompareToThrowsOnTypeMismatch()
        {
            ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1);

// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            voltac.CompareTo(new object());
        }
示例#5
0
        public void CompareToThrowsOnNull()
        {
            ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1);

            Assert.Throws <ArgumentNullException>(() => voltac.CompareTo(null));
        }
示例#6
0
        public void CompareToThrowsOnTypeMismatch()
        {
            ElectricPotentialAc voltac = ElectricPotentialAc.FromVoltsAc(1);

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