Beispiel #1
0
        public void CompareToIsImplemented()
        {
            ElectricConductance siemens = ElectricConductance.FromSiemens(1);

            Assert.Equal(0, siemens.CompareTo(siemens));
            Assert.True(siemens.CompareTo(ElectricConductance.Zero) > 0);
            Assert.True(ElectricConductance.Zero.CompareTo(siemens) < 0);
        }
Beispiel #2
0
        public void CompareToThrowsOnNull()
        {
            ElectricConductance siemens = ElectricConductance.FromSiemens(1);

            Assert.Throws <ArgumentNullException>(() => siemens.CompareTo(null));
        }
Beispiel #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            ElectricConductance siemens = ElectricConductance.FromSiemens(1);

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