Exemplo n.º 1
0
        public DojoView(DojoViewModel vm, IEventAggregator eventAggregator, ISession session)
        {
            _eventAggregator = eventAggregator;
            _session = session;

            InitializeComponent();

            vm.PropertyChanged += OnLastKeyChanged;
            Loaded += (s, e) => DataContext = vm;
            _eventAggregator.GetEvent<KataFinishedEvent>().Subscribe(OnKataFinishedEvent);
        }
        public void Setup()
        {
            _interceptKeys = MockRepository.GenerateStub<IInterceptKeys>();
            _codingDojo = MockRepository.GenerateStub<ICodingDojo>();

            _eventAggregator = MockRepository.GenerateStub<IEventAggregator>();
            _startKataEvent = new StartKataEvent();
            _eventAggregator.Stub(x => x.GetEvent<StartKataEvent>()).Return(_startKataEvent);
            _kataFinishedEvent = new KataFinishedEvent();
            _eventAggregator.Stub(x => x.GetEvent<KataFinishedEvent>()).Return(_kataFinishedEvent);

            _session = MockRepository.GenerateStub<ISession>();

            _target = new DojoViewModel(_interceptKeys, _codingDojo, _eventAggregator, _session);
        }