Ejemplo n.º 1
0
        public void CompareToIsImplemented()
        {
            ElectricInductance henry = ElectricInductance.FromHenries(1);

            Assert.Equal(0, henry.CompareTo(henry));
            Assert.True(henry.CompareTo(ElectricInductance.Zero) > 0);
            Assert.True(ElectricInductance.Zero.CompareTo(henry) < 0);
        }
Ejemplo n.º 2
0
        public void CompareToThrowsOnNull()
        {
            ElectricInductance henry = ElectricInductance.FromHenries(1);

            Assert.Throws <ArgumentNullException>(() => henry.CompareTo(null));
        }
Ejemplo n.º 3
0
        public void CompareToThrowsOnTypeMismatch()
        {
            ElectricInductance henry = ElectricInductance.FromHenries(1);

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