public void TrackPageEvent_InActiveTracker_ShouldNotTrack(Database db, [Content] Item item, ITracker tracker, TrackerService trackerService) { using (new TrackerSwitcher(tracker)) { trackerService.TrackPageEvent(item.ID); tracker.CurrentPage.DidNotReceive().Register(Arg.Is<PageEventItem>(x => x.ID == item.ID)); } }
public void TrackPageEvent_ValidID_ShouldTrackById(Database db, [Content] Item item, ITracker tracker, TrackerService trackerService) { tracker.IsActive.Returns(true); using (new TrackerSwitcher(tracker)) { trackerService.TrackPageEvent(item.ID); tracker.CurrentPage.Received(1).Register(Arg.Is<PageEventItem>(x => x.ID == item.ID)); } }
public void TrackPageEvent_NullTracker_ShouldNotTrackEvent(Database db, [Content] Item item, ITracker tracker, TrackerService trackerService) { trackerService.TrackPageEvent(item.ID); tracker.CurrentPage.DidNotReceive().Register(Arg.Is<PageEventItem>(x => x.ID == item.ID)); }
public void TrackPageEvent_NullEvent_ShouldThrowArgumentException(TrackerService trackerService) { trackerService.Invoking(x => x.TrackPageEvent(null)).ShouldThrow<ArgumentNullException>(); }