public void EndToEnd_BothViews_DataIsStoredRetrievedApprovedAndSaved()
        {
            const string firstName = "John";
            const string lastName = "Smith";
            const string gymMembershipId = "ABCD1234";
            var member = new Member {FirstName = firstName, LastName = lastName, GymMembershipId = gymMembershipId};

            var sutPage1 = new GatherMemberInfoPresenter(_tempDataRepository, _gatherMemberInfoView);
            var fakeView1 = (FakeGatherMemberInfoView) _gatherMemberInfoView;
            fakeView1.TriggerEvent_GatherMemberInfo(member);

            Assert.IsTrue(fakeView1.GoToNextViewMethodIsCalled);

            var sutPage2 = new RenewMembershipPresenter(_tempDataRepository, _nationalFitnessGateway,
                                                        _ccProcessingGateway, _memberRepository, _renewMembershipView);
            var fakeView2 = (FakeRenewMembershipView) _renewMembershipView;

            fakeView2.TriggerEvent_Initialize();
            Assert.AreEqual(member, _renewMembershipView.Member);

            fakeView2.TriggerEvent_RenewMembership();

            const bool isPaid = true;
            var expectedFinalMessage = ApplicationConstants.FormatApprovalMessageForMember(member, isPaid);

            Assert.AreEqual(member, _renewMembershipView.Member);
            Assert.AreEqual(expectedFinalMessage, fakeView2.Message);
        }
        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();
        }
 // the goal of a fake: happy test pass
 public bool StoreMemberValues(Member member)
 {
     _member = member;
     return true;
 }
 public NationalFitnessResultsDTO VerifyMember(Member member)
 {
     // the goal of a fake: happy test pass
     return new NationalFitnessResultsDTO {IsVerified = true};
 }
 public void SaveMember(Member member)
 {
     // the goal of a fake: happy test pass
 }
 public void TriggerEvent_GatherMemberInfo(Member member)
 {
     this.GatherMemberInfo(this, new GatherMemberInfoEventArgs {Member = member});
 }