/// <summary>
        /// Creates a new <see cref="TransactionFilterViewModel"/> instance.
        /// </summary>
        /// 
        /// <param name="accountService">The account service.</param>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="kernel">The Ninject kernel.</param>
        public TransactionFilterViewModel(
            IAccountService accountService,
            IEventAggregator eventAggregator,
            IKernel kernel)
        {
            _accountService = accountService;
            _filterItemChangedEvent = eventAggregator.GetEvent<TransactionFilterItemChangedEvent>();
            _kernel = kernel;

            FilterGroups = new ObservableCollection<TransactionFilterGroupViewModel>();
            FilterGroups.CollectionChanged += OnFilterGroupsCollectionChanged;

            AddFilterItems();
        }
        public void TransactionFilterItemChangedEvent_WhenPublished_CurrentFilterItemIsSet()
        {
            var filterItemChangedEvent = new TransactionFilterItemChangedEvent();
            var filterItem = new TransactionFilterItemViewModel();

            TransactionListViewModel viewModel;
            {
                var eventAggregator = MockRepository.GenerateStub<IEventAggregator>();
                eventAggregator
                    .Stub(ea => ea.GetEvent<TransactionFilterItemChangedEvent>())
                    .Return(filterItemChangedEvent);

                viewModel = CreateTransactionListViewModel(eventAggregator);
            }

            filterItemChangedEvent.Publish(filterItem);

            Assert.AreEqual(filterItem, viewModel.CurrentFilterItem);
        }