public void TrackLogin_Call_ShouldTrackLoginGoal(string identifier, Db db, [Frozen] ITrackerService trackerService, [Greedy] AccountTrackerService accountTrackerService)
        {
            //Arrange
            db.Add(new DbItem("Item", AccountTrackerService.LoginGoalId));

            //Act
            accountTrackerService.TrackLogin(identifier);

            //Assert
            trackerService.Received().TrackPageEvent(Arg.Is <ID>(AccountTrackerService.LoginGoalId));
        }
Пример #2
0
        public void TrackLogin_Call_ShouldTrackLoginGoal(string identifier, Db db, ITracker tracker, AccountTrackerService accountTrackerService, [Substitute] Session session)
        {
            tracker.IsActive.Returns(true);
            tracker.Session.Returns(session);
            db.Add(new DbItem("Item", ConfigSettings.LoginGoalId));

            using (new TrackerSwitcher(tracker))
            {
                accountTrackerService.TrackLogin(identifier);
                tracker.CurrentPage.Received(1).Register(Arg.Is <PageEventItem>(x => x.ID == ConfigSettings.LoginGoalId));
            }
        }