本文整理汇总了C#中ITracker.GetContactOutcomes方法的典型用法代码示例。如果您正苦于以下问题:C# ITracker.GetContactOutcomes方法的具体用法?C# ITracker.GetContactOutcomes怎么用?C# ITracker.GetContactOutcomes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITracker
的用法示例。
在下文中一共展示了ITracker.GetContactOutcomes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrackOutcome_InactiveTracker_ShouldNotTrack
public void TrackOutcome_InactiveTracker_ShouldNotTrack([Frozen]ID outcomeDefinitionId, [Frozen]IAccountsSettingsService accountsSettingsService, [NoAutoProperties] AccountTrackerService trackerService, ITracker tracker)
{
// Arrange
tracker.IsActive.Returns(false);
tracker.Session.Returns(Substitute.For<Session>());
tracker.Session.CustomData.Returns(new Dictionary<string, object>());
using (new TrackerSwitcher(tracker))
{
// Act
trackerService.TrackOutcome(outcomeDefinitionId);
// Assert
tracker.GetContactOutcomes().Should().BeEmpty();
}
}
示例2: TrackRegister_Call_ShouldTrackRegistrationGoal
public void TrackRegister_Call_ShouldTrackRegistrationGoal(Db db, ID outcomeID, ITracker tracker, [Frozen]IAccountsSettingsService accountsSettingsService, AccountTrackerService accountTrackerService)
{
// Arrange
tracker.IsActive.Returns(true);
tracker.Contact.Returns(Substitute.For<Contact>());
tracker.Interaction.Returns(Substitute.For<CurrentInteraction>());
tracker.Session.Returns(Substitute.For<Session>());
tracker.Session.CustomData.Returns(new Dictionary<string, object>());
accountsSettingsService.GetRegistrationOutcome(Arg.Any<Item>()).Returns(outcomeID);
db.Add(new DbItem("Item", ConfigSettings.RegistrationGoalId));
db.Add(new DbItem("Item", ConfigSettings.LoginGoalId));
using (new TrackerSwitcher(tracker))
{
accountTrackerService.TrackRegistration();
tracker.CurrentPage.Received(1).Register(Arg.Is<PageEventItem>(x => x.ID == ConfigSettings.RegistrationGoalId));
tracker.GetContactOutcomes().Should().Contain(o => o.DefinitionId == outcomeID);
}
}
示例3: TrackOutcome_ValidOutcome_ShouldRegisterOutcome
public void TrackOutcome_ValidOutcome_ShouldRegisterOutcome([Frozen]ID outcomeDefinitionId, [Frozen]IAccountsSettingsService accountsSettingsService, [NoAutoProperties] AccountTrackerService trackerService, ITracker tracker, Contact contact, CurrentInteraction interaction)
{
tracker.IsActive.Returns(true);
tracker.Contact.Returns(contact);
tracker.Interaction.Returns(interaction);
tracker.Session.Returns(Substitute.For<Session>());
tracker.Session.CustomData.Returns(new Dictionary<string, object>());
using (new TrackerSwitcher(tracker))
{
trackerService.TrackOutcome(outcomeDefinitionId);
tracker.GetContactOutcomes().Should().Contain(o => o.DefinitionId == outcomeDefinitionId);
}
}