Пример #1
0
 public Turnstile()
 {
     this.barrier     = new Barrier();
     this.alarm       = new Alarm();
     this.coinMachine = new CoinMachine();
     this.context     = new TurnstileContext(barrier, alarm, coinMachine);
     this.context.EnterInitialState();
 }
Пример #2
0
 public void Setup()
 {
     repository            = new MockRepository();
     this.barrier          = repository.StrictMock <Barrier>();
     this.alarm            = repository.StrictMock <Alarm>();
     this.coinMachine      = repository.StrictMock <CoinMachine>();
     observer              = repository.StrictMock <IObserver>();
     this.context          = new TurnstileContext(this.barrier, this.alarm, this.coinMachine);
     this.context.Observer = observer;
 }