Ejemplo n.º 1
0
        public void EqualsIsImplemented()
        {
            ElectricCurrent v = ElectricCurrent.FromAmperes(1);

            Assert.IsTrue(v.Equals(ElectricCurrent.FromAmperes(1)));
            Assert.IsFalse(v.Equals(ElectricCurrent.Zero));
        }
Ejemplo n.º 2
0
        public void EqualsIsImplemented()
        {
            ElectricCurrent v = ElectricCurrent.FromAmperes(1);

            Assert.True(v.Equals(ElectricCurrent.FromAmperes(1), ElectricCurrent.FromAmperes(AmperesTolerance)));
            Assert.False(v.Equals(ElectricCurrent.Zero, ElectricCurrent.FromAmperes(AmperesTolerance)));
        }
 public void OpEquals()
 {
     var current1 = new ElectricCurrent(3000, ElectricCurrentUnit.Ampere);
     var current2 = new ElectricCurrent(3, ElectricCurrentUnit.KiloAmpere);
     var current3 = new ElectricCurrent(6, ElectricCurrentUnit.KiloAmpere);
     (current1 == current2).ShouldBeTrue();
     (current2 == current1).ShouldBeTrue();
     (current1 == current3).ShouldBeFalse();
     (current3 == current1).ShouldBeFalse();
     current1.Equals(current2)
             .ShouldBeTrue();
     current1.Equals((object)current2)
             .ShouldBeTrue();
     current2.Equals(current1)
             .ShouldBeTrue();
     current2.Equals((object)current1)
             .ShouldBeTrue();
 }