import { ConcreteFactory1 , ConcreteFactory2 , ConcreteProductA1 , ConcreteProductA2 , ConcreteProductB1 , ConcreteProductB2 , } from '../src/abstract-factory' ; test ( 'abstract-factory.ts -> ConcreteFactory1' , ( ) => { const factory = new ConcreteFactory1 ( ) ; const productA = factory . createProductA ( ) ; expect ( productA ) . toBeInstanceOf ( ConcreteProductA1 ) ; expect ( productA . operationA ( ) ) . toEqual ( 'ConcreteProductA1' ) ; const productB = factory . createProductB ( ) ; expect ( productB ) . toBeInstanceOf ( ConcreteProductB1 ) ; expect ( productB . operationB ( ) ) . toEqual ( 'ConcreteProductB1' ) ; } ) ; test ( 'abstract-factory.ts -> ConcreteFactory2' , ( ) => { const factory = new ConcreteFactory2 ( ) ; const productA = factory . createProductA ( ) ; expect ( productA ) . toBeInstanceOf ( ConcreteProductA2 ) ; expect ( productA . operationA ( ) ) . toEqual ( 'ConcreteProductA2' ) ; const productB = factory . createProductB ( ) ; expect ( productB ) . toBeInstanceOf ( ConcreteProductB2 ) ; expect ( productB . operationB ( ) ) . toEqual ( 'ConcreteProductB2' ) ; } ) ;