Exemple #1
0
        public void CreateStudent_NotInKredek()
        {
            StudentFactory sut = new StudentFactory();

            TalentedPerson student = sut.Create("StudentWithoutSuperPowe");

            Assert.IsType <Student>(student);
        }
Exemple #2
0
        public void CreateSeparateObjects()
        {
            StudentFactory sut = new StudentFactory();

            TalentedPerson student1 = sut.Create("StudentWithoutSuperPower");
            TalentedPerson student2 = sut.Create("StudentWithoutSuperPower");

            Assert.NotSame(student1, student2);
        }
Exemple #3
0
    static void Main()
    {
        TalentedPerson dude     = new TalentedPerson();
        IMusician      musician = dude;

        musician.PlayMusic();
        dude.PlayMusic();
        dude.DoALittleDance();
    }
        public void CreateStudent_NotInKredek()
        {
            StudentFactory sut = new StudentFactory();

            TalentedPerson student1 = sut.Create("StudentWithoutSpecialPower");
            TalentedPerson student2 = sut.Create("StudentWithoutSpecialPower");

            Assert.NotSame(student1, student2);
        }