Exemple #1
0
        public void CompareToIsImplemented()
        {
            Magnetization amperepermeter = Magnetization.FromAmperesPerMeter(1);

            Assert.Equal(0, amperepermeter.CompareTo(amperepermeter));
            Assert.True(amperepermeter.CompareTo(Magnetization.Zero) > 0);
            Assert.True(Magnetization.Zero.CompareTo(amperepermeter) < 0);
        }
Exemple #2
0
        public void CompareToThrowsOnNull()
        {
            Magnetization amperepermeter = Magnetization.FromAmperesPerMeter(1);

            Assert.Throws <ArgumentNullException>(() => amperepermeter.CompareTo(null));
        }
Exemple #3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            Magnetization amperepermeter = Magnetization.FromAmperesPerMeter(1);

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