public void MeasurementAnalyticsClient_Replays_Tracked_Activities_After_Configured()
        {
            var actual = new List<Uri>();

            var client = new MeasurementAnalyticsClient();
            client.Track(new ScreenViewActivity("The Big Screen"));
            client.Track(new ScreenViewActivity("Silk Screen"));

            MeasurementTestHelpers.ConfigureForTest(client, actual.Add);

            Assert.AreEqual(2, actual.Count);
        }
        public void MeasurementAnalyticsClient_Track_Ends_AutoTimedEventActivity()
        {
            var client = new MeasurementAnalyticsClient();
            var autoTimedEvent = new AutoTimedEventActivity("Category", "Variable");

            client.Track(autoTimedEvent);

            Assert.IsNotNull(autoTimedEvent.EndedAt);
        }
        public void MeasurementAnalyticsClient_OnTrack_Fires_When_Tracked()
        {
            var fired = false;
            var analyticsClient = new MeasurementAnalyticsClient();

            analyticsClient.OnTrack += (s, e) => fired = true;
            analyticsClient.Track(new AppViewActivity("Testing"));

            Assert.IsTrue(fired);
        }
        public void MeasurementAnalyticsClient_OnTrack_Fires_After_AutoTimedEvent_Ended()
        {
            DateTimeOffset? endedAt = null;
            var analyticsClient = new MeasurementAnalyticsClient();
            var autoTimedEvent = new AutoTimedEventActivity("Category", "Variable");

            analyticsClient.OnTrack += (s, e) => { endedAt = ((AutoTimedEventActivity) e).EndedAt; };
            analyticsClient.Track(autoTimedEvent);

            Assert.IsNotNull(endedAt);
        }