Esempio n. 1
0
        public void CompareToIsImplemented()
        {
            Luminosity watt = Luminosity.FromWatts(1);

            Assert.Equal(0, watt.CompareTo(watt));
            Assert.True(watt.CompareTo(Luminosity.Zero) > 0);
            Assert.True(Luminosity.Zero.CompareTo(watt) < 0);
        }
Esempio n. 2
0
        public void CompareToThrowsOnNull()
        {
            Luminosity watt = Luminosity.FromWatts(1);

            Assert.Throws <ArgumentNullException>(() => watt.CompareTo(null));
        }
Esempio n. 3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            Luminosity watt = Luminosity.FromWatts(1);

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