Ejemplo n.º 1
0
        public void PresenterPublishesFundAddedOnViewAddClick()
        {
            var view = new MockAddFundView();
            var EventAggregator = new MockEventAggregator();
            var mockFundAddedEvent = new MockFundAddedEvent();
            EventAggregator.AddMapping<FundAddedEvent>(mockFundAddedEvent);
            var presenter = new AddFundPresenter(EventAggregator);
            presenter.View = view;
            view.Customer = "99";
            view.Fund = "TestFund";

            view.PublishAddClick();

            Assert.IsTrue(mockFundAddedEvent.PublishCalled);
            Assert.AreEqual("99", mockFundAddedEvent.PublishArgumentPayload.CustomerId);
            Assert.AreEqual("TestFund", mockFundAddedEvent.PublishArgumentPayload.TickerSymbol);
        }
Ejemplo n.º 2
0
        public void PresenterPublishesFundAddedOnViewAddClick()
        {
            var view               = new MockAddFundView();
            var EventAggregator    = new MockEventAggregator();
            var mockFundAddedEvent = new MockFundAddedEvent();

            EventAggregator.AddMapping <FundAddedEvent>(mockFundAddedEvent);
            var presenter = new AddFundPresenter(EventAggregator);

            presenter.View = view;
            view.Customer  = "99";
            view.Fund      = "TestFund";

            view.PublishAddClick();

            Assert.IsTrue(mockFundAddedEvent.PublishCalled);
            Assert.AreEqual("99", mockFundAddedEvent.PublishArgumentPayload.CustomerId);
            Assert.AreEqual("TestFund", mockFundAddedEvent.PublishArgumentPayload.TickerSymbol);
        }