Exemplo n.º 1
0
        public void ArtistCreationWithConcreteFactory1()
        {
            AbstractFactory factory = ConcreteFactory1.GetFactory();
            IPerson         x       = factory.CreateArtist();

            Assert.AreSame(x.GetType(), typeof(Actor));
        }
Exemplo n.º 2
0
        public void DoctorCreationWithConcreteFactory1()
        {
            AbstractFactory factory = ConcreteFactory1.GetFactory();
            IPerson         x       = factory.CreateDoctor();

            Assert.AreSame(x.GetType(), typeof(Cardiologist));
        }
Exemplo n.º 3
0
        public void TeacherCreationWithConcreteFactory1()
        {
            AbstractFactory factory = ConcreteFactory1.GetFactory();
            IPerson         x       = factory.CreateTeacher();

            Assert.AreSame(x.GetType(), typeof(EnglishTeacher));
        }
Exemplo n.º 4
0
        public void DoctorCreationTestWithReflectionConcreteFactory1()
        {
            AbstractFactory factory = ConcreteFactory1.GetFactory();
            IPerson         x       = factory.CreatePerson <Cardiologist>();

            Assert.AreSame(x.GetType(), typeof(Cardiologist));
        }