public void TestPhoneNumberAddMethod() { OOP_7.PhoneNumber phone_number1 = new OOP_7.PhoneNumber(); phone_number1.Init("Ленина", "Ленин", 100, 300); OOP_7.PhoneNumber phone_number2 = new OOP_7.PhoneNumber(); phone_number2.Init("Сталина", "Сталин", 1000, 3000); OOP_7.PhoneNumber phone_number3 = new OOP_7.PhoneNumber(); phone_number3.Init("Ленина", String.Concat(phone_number1._surname, " - ", phone_number2._surname), 1100, 3000); OOP_7.PhoneNumber phone_number_test = phone_number1.Add(phone_number1, phone_number2); Assert.AreEqual(phone_number3._address, phone_number_test._address); Assert.AreEqual(phone_number3._surname, phone_number_test._surname); Assert.AreEqual(phone_number3._payment, phone_number_test._payment); Assert.AreEqual(phone_number3._credit, phone_number_test._credit); phone_number2._credit = 50; phone_number3._credit = 300; phone_number_test = phone_number1.Add(phone_number1, phone_number2); Assert.AreEqual(phone_number3._address, phone_number_test._address); Assert.AreEqual(phone_number3._surname, phone_number_test._surname); Assert.AreEqual(phone_number3._payment, phone_number_test._payment); Assert.AreEqual(phone_number3._credit, phone_number_test._credit); }
public void TestPhoneNumberDisplayMethod() { string address = "Ленина"; string surname = "Ленин"; double payment = 100; double credit = 300; OOP_7.PhoneNumber phone_number_test = new OOP_7.PhoneNumber(); phone_number_test.Init(address, surname, payment, credit); Assert.IsTrue(phone_number_test.Display()); }
public void TestPhoneNumberInitMethod() { string address = "Ленина"; string surname = "Ленин"; double payment = 100; double credit = 300; OOP_7.PhoneNumber phone_number_test = new OOP_7.PhoneNumber(); phone_number_test.Init(address, surname, payment, credit); Assert.AreEqual(address, phone_number_test._address); Assert.AreEqual(surname, phone_number_test._surname); Assert.AreEqual(payment, phone_number_test._payment); Assert.AreEqual(credit, phone_number_test._credit); }