コード例 #1
0
        public void PhoneContactEquels()
        {
            PhoneContact contact1 = new PhoneContact("Oleg", 12345);

            object       result = contact1.Clone();
            PhoneContact actual = (PhoneContact)result;

            Assert.AreEqual(contact1.name, actual.name);
        }
コード例 #2
0
        public void CloneTest()
        {
            const string name         = "anna";
            const string phone        = "2513529";
            PhoneContact phoneContact = new PhoneContact(name, phone);
            object       result       = phoneContact.Clone();

            PhoneContact actual = (PhoneContact)result;

            Assert.IsNotNull(actual);
            Assert.AreEqual(name, actual.Name);
            Assert.AreEqual(phone, actual.Info);
        }