示例#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);
        }
示例#2
0
 public void TestOverrideToString()
 {
     Assert.AreEqual("Name: Jacob", _stundent.ToString());
 }