public void SetUp()
        {
            _container = new RhinoAutoMocker<EntryPresenter>();
            _systemUnderTest = _container.ClassUnderTest;
            _entryView = _container.Get<IEntryView>();
            _repository = _container.Get<IRepository>();
            _recentActivities = _container.Get<IRecentActivities>();

              	_recentActivities
              		.Stub(x => x.First)
              		.Return(ACTIVITY);

              	_recentActivities
              		.Stub(x => x.ToArray())
              		.Return(new[]{ ACTIVITY });

              	_entryView
                .Stub(x => x.Duration)
                .Return(DURATION);

            _entryView
                .Stub(x => x.Activity)
                .Return(ACTIVITY);

            _entryView.Stub(x => x.Note).Return(NOTE);
            _entryView.Raise(x => x.KeyDown += null, this, new KeyEventArgs(Keys.Enter));
        }
예제 #2
0
        public EntryPresenter(IEntryView taskEntryView, IRepository repository, IRecentActivities recentActivities)
        {
            _entryView = taskEntryView;
            _repository = repository;
            _recentActivities = recentActivities;

            taskEntryView.DurationTextChanged += DurationChanged;
            taskEntryView.KeyDown += TimeTrackerViewKeyDown;
        }