Пример #1
0
        public void MonederoEquals()
        {
            //NOTE: Normally we use Assert.AreEqual to test whether two
            // objects are equal. But here we are testing the Monedero.Equals()
            // method itself, so using AreEqual would not serve the purpose.
            Assert.IsFalse(_monedero1.Equals(null));

            Assert.IsTrue(_monedero1.Equals(_monedero1));
            Monedero equal = new Monedero(new Moneda(12, Divisa.MXN), new Moneda(7, Divisa.USD));

            Assert.IsTrue(_monedero1.Equals(equal));
            Assert.IsTrue(!_monedero1.Equals(_moneda12MXN));
            Assert.IsTrue(!_moneda12MXN.Equals(_monedero1));
            Assert.IsTrue(!_monedero1.Equals(_monedero2));
        }