Exemple #1
0
 public DemoController(IDemoStateService demoStateService, IExperienceDataFactory experienceDataFactory)
 {
     this.DemoStateService      = demoStateService;
     this.ExperienceDataFactory = experienceDataFactory;
 }
Exemple #2
0
        public void ExperienceData_InitializedTrackerAndNormalMode_ReturnExperienceData(IKeyBehaviorCache keyBehaviorCache, Session session, CurrentInteraction currentInteraction, ITracker tracker, Contact contact, [Frozen] IProfileProvider profileProvider, [Frozen] IDemoStateService demoState, [Frozen] IExperienceDataFactory dataFactory, [Greedy] DemoController sut)
        {
            demoState.IsDemoEnabled.Returns(true);
            dataFactory.Get().Returns(new ExperienceData());
            tracker.Interaction.Returns(currentInteraction);
            tracker.Session.Returns(session);
            var attachments = new Dictionary <string, object>
            {
                ["KeyBehaviorCache"] = new Analytics.Tracking.KeyBehaviorCache(keyBehaviorCache)
            };

            contact.Attachments.Returns(attachments);
            tracker.Contact.Returns(contact);

            var fakeSite = new FakeSiteContext(new StringDictionary
            {
                { "displayMode", "normal" }
            }) as SiteContext;

            using (new SiteContextSwitcher(fakeSite))
            {
                using (new TrackerSwitcher(tracker))
                {
                    var result = sut.ExperienceData();
                    result.Should().BeOfType <ViewResult>().Which.Model.Should().BeOfType <ExperienceData>();
                }
            }
        }