Exemple #1
0
        public void Presenter_UpdateCustomerView_ShouldPopulateViewWithRightCustomer()
        {
            var mockRepo = Mock.Get(mockCustomerRepository);

            mockRepo.Setup(repository => repository.GetCustomer(1)).Returns(stubCustomerList[1]);

            presenter.UpdateCustomerView(1);

            var mockView = Mock.Get(mockCustomerView);

            mockView.VerifySet(view => view.CustomerName = stubCustomerList[1].Name);
            mockView.VerifySet(view => view.Currency     = stubCustomerList[1].Currency);
            mockView.VerifySet(view => view.Cash         = stubCustomerList[1].Cash);
        }
Exemple #2
0
        public void Presenter_UpdateCustomerView_ShouldPopulateViewWithRightCustomer()
        {
            var mockRepo = Mock.Get(mockCustomerRepository);

            mockRepo.Setup(repository => repository.GetCustomer(1)).Returns(stubCustomerList[1]);

            presenter.UpdateCustomerView(1);

            var mockView = Mock.Get(mockCustomerView);

            mockView.VerifySet(view => view.CustomerName = stubCustomerList[1].Name);
            mockView.VerifySet(view => view.Address      = stubCustomerList[1].Address);
            mockView.VerifySet(view => view.Phone        = stubCustomerList[1].Phone);
            // or just Assert.True(mockCustomerView.CustomerName == stubCustomerList[1].Name && ...);
        }