Exemplo n.º 1
0
        void _gatherMemberInfoView_GatherMemberInfo(object sender, EventArgs e)
        {
            var gmiea        = (GatherMemberInfoEventArgs)e;
            var isSuccessful = _tempDataRepository.StoreMemberValues(gmiea.Member);

            _gatherMemberInfoView.GoToNextView();
        }
        public void GatherMemberInfoEvent_MemberInput_InstructsToGoToNextView()
        {
            // define out expectations (of how the Presenter will coordinate the interfaces
            _gatherMemberInfoView.GatherMemberInfo += null;
            var gatherMemberInfoEvent = LastCall.IgnoreArguments().GetEventRaiser();

            const string firstName       = "Sally";
            const string lastName        = "Wong";
            const string gymMembershipId = "AB1234";
            var          member          = new Member {
                FirstName = firstName, LastName = lastName, GymMembershipId = gymMembershipId
            };

            Expect.Call(_tempDataRepository.StoreMemberValues(member)).Return(true);
            _gatherMemberInfoView.GoToNextView();

            // put the mock into replay (instantiate the presenter)
            _mockRepository.ReplayAll();

            var sut = new GatherMemberInfoPresenter(_tempDataRepository, _gatherMemberInfoView);

            gatherMemberInfoEvent.Raise(_gatherMemberInfoView, new GatherMemberInfoEventArgs {
                Member = member
            });

            // verify the mock
            _mockRepository.VerifyAll();
        }