コード例 #1
0
        public void ToString()
        {
            var student = new Student();

            student.StudentNumber = 10;
            student.SetName("John");
            student.SetLastName("Lennon");
            var expectedToString = "Number: 10, Name: John Lennon";

            Assert.AreEqual(expectedToString, student.ToString());
        }
コード例 #2
0
        public void GetFullNameAndLocation()
        {
            var student = new Student();

            student.StudentNumber = 10;
            student.SetName("John");
            student.SetLastName("Lennon");
            student.SetLocation(new Location());
            var expectedString = "John Lennon: (0, 0)";

            Assert.AreEqual(expectedString, student.GetFullNameAndLocation());
        }