Exemplo n.º 1
0
        public void TestMethodForClassMailContact()
        {
            MailContact  phone = new MailContact("Roman", "*****@*****.**");
            StreamWriter sw    = new StreamWriter("FileForTest.txt");

            phone.WrtiteToFile(sw);
            sw.Close();
            MailContact phone1 = new MailContact();

            using (StreamReader sr = new StreamReader("FileForTest.txt"))
            {
                phone1.ReadFromFile(sr);
            }
            Assert.IsTrue(phone1.Name == "Roman," && phone1.Email == "*****@*****.**" && phone.Name == "Roman" && phone.Email == "*****@*****.**");
        }