Esempio n. 1
0
        public void TestAdultEductionPupilsHierarchie_ShouldBeDerivedFromPupil()
        {
            Person p = new AdultEductionPupil("Scott", "Lang", 2018, 3, "Ant Man");

            Assert.IsTrue(
                p is Pupil,
                "The class AdultEducationPupil has to be derived from class Pupil!");
        }
Esempio n. 2
0
        public void TestAdultEductionPupilsToString_ShouldContainJob()
        {
            AdultEductionPupil p = new AdultEductionPupil("Clark", "Kent", 2015, 2, "Superman");

            Assert.IsTrue(
                p.ToString().Contains("Currently working as 'Superman'"),
                @"The ToString() method should return a string containing the job following the format ""Currently working as '<Job>'""!");
        }
Esempio n. 3
0
        public void TestAdultEductionPupilsHierarchie_ShouldBeDerivedFromPerson()
        {
            Person p = new AdultEductionPupil("Louis", "Lane", 2016, 7, "Reporter");

            Assert.IsTrue(
                p is Person,
                "The class AdultEducationPupil has to be derived from class Person!");
        }
Esempio n. 4
0
        public void TestAdultEductionPupilsToString_ShouldContainRegistrationNumber()
        {
            AdultEductionPupil p = new AdultEductionPupil("Paul", "Landner", 2017, 13, "Carpenter");

            Assert.IsTrue(
                p.ToString().Contains("RegistrationNr: AB170013"),
                @"The ToString() method should return a string containing the registration number which follows the format 'RegistrationNr: AB<inscription year><inscription number>!'"
                );
        }