Ejemplo n.º 1
0
        private void TestUsingFactory()
        {
            AFP_Camere camera = null;
            AFP_ITake  lens   = null;

            foreach (AFP_IMakeCamera factory in factories)
            {
                camera = factory.MakeCamera();
                lens   = factory.MakeLens();
                TestCase(camera, lens); // 호환성 테스트
            }
        }
Ejemplo n.º 2
0
 private void TestCase(AFP_Camere camera, AFP_ITake lens)
 {
     Console.WriteLine("Test");
     if (camera.PutInLens(lens) == false)
     {
         Console.WriteLine("Lens not setted in camera");
     }
     if (camera.TakeAPicture() == false)
     {
         Console.WriteLine("Picture has not taken");
     }
 }