Beispiel #1
0
        public void StudentPrintTest()
        {
            Student student = new Student("Alex", "Pmi-32", "KlakovichLM");

            using (StreamWriter sw = new StreamWriter("TestPrint.txt"))
            {
                student.Print(sw);
            }
            //  string path = System.IO.Directory.GetCurrentDirectory().Replace("bin\\Debug", "TestPrint.txt");
            string path     = "TestPrint.txt";
            string expected = student.ToString();
            string actual;

            using (StreamReader sr = new StreamReader(path))
            {
                actual = sr.ReadLine();
            }
            Assert.AreEqual(actual, expected);
        }