Example #1
0
        public void Get_Call_ShouldCombineActiveAndHistoricCampaigns(string site, CurrentInteraction currentInteraction, ITracker tracker, [Frozen] ICampaignRepository campaignRepository, [Greedy] ReferralRepository referralRepository)
        {
            //Arrange
            tracker.Interaction.Returns(currentInteraction);
            tracker.Interaction.ReferringSite.Returns(site);

            campaignRepository.GetCurrent().Returns(new Campaign()
            {
                Title = "camp1"
            });
            campaignRepository.GetHistoric().Returns(new[] { new Campaign()
                                                             {
                                                                 Title = "camp2"
                                                             }, new Campaign()
                                                             {
                                                                 Title = "camp3"
                                                             } });

            using (new TrackerSwitcher(tracker))
            {
                //Act
                var referral = referralRepository.Get();
                //Assert
                referral.TotalNoOfCampaigns.Should().Be(3);
                referral.Campaigns.Select(x => x.Title).Should().Contain(new[] { "camp1", "camp2", "camp3", });
            }
        }
Example #2
0
 public ExperienceData(VisitsRepository visitsRepository, PersonalInfoRepository personalInfoRepository, OnsiteBehaviorRepository onsiteBehaviorRepository, ReferralRepository referralRepository, ITrackerService trackerService)
 {
     this.Visits         = visitsRepository.Get();
     this.PersonalInfo   = personalInfoRepository.Get();
     this.OnsiteBehavior = onsiteBehaviorRepository.Get();
     this.Referral       = referralRepository.Get();
     this.IsActive       = trackerService.IsActive;
 }
Example #3
0
        public void Get_Call_ShouldReturnReferringSite(string site, CurrentInteraction currentInteraction, ITracker tracker, ICampaignRepository campaignRepository, [Greedy] ReferralRepository referralRepository)
        {
            //Arrange
            tracker.Interaction.Returns(currentInteraction);
            tracker.Interaction.ReferringSite.Returns(site);

            using (new TrackerSwitcher(tracker))
            {
                //Act
                var referral = referralRepository.Get();
                //Assert
                referral.ReferringSite.Should().Be(site);
            }
        }