Exemplo n.º 1
0
 public PageViewService(IPageViewRepository pageViewRepository)
 {
     this.pageViewRepository = pageViewRepository;
 }
Exemplo n.º 2
0
        public void Get_PageViews_ReturnReversedPages(ITracker tracker, [Frozen] IContactFacetsProvider contactProfileProvider, [Frozen] IPageViewRepository viewRepository, VisitsRepository visitsRepository)
        {
            //Arrange
            this.InitTracker(tracker);
            var pages = new List <ICurrentPageContext>
            {
                this.GeneratePage(path: "0"),
                this.GeneratePage(path: "1"),
                this.GeneratePage(path: "2")
            };

            tracker.Interaction.GetPages().Returns(pages);
            contactProfileProvider.Contact.Returns(x => tracker.Contact);
            viewRepository.Get(Arg.Any <ICurrentPageContext>()).Returns(x => new PageView()
            {
                Path = x.Arg <ICurrentPageContext>().Url.Path
            });

            using (new TrackerSwitcher(tracker))
            {
                //Act
                var visits = visitsRepository.Get();
                //Assert
                visits.PageViews.Select(x => x.Path).Should().BeEquivalentTo("2", "1", "0");
            }
        }
 public VisitsRepository(IContactFacetsProvider contactFacetsProvider, IEngagementPlanStateRepository engagementPlanStateRepository, IPageViewRepository pageViewRepository)
 {
     this.contactFacetsProvider         = contactFacetsProvider;
     this.engagementPlanStateRepository = engagementPlanStateRepository;
     this.pageViewRepository            = pageViewRepository;
 }