예제 #1
0
        private void OnSuspension(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            _playerTracker?.TrackDuration(DateTimeOffset.Now);
            deferral.Complete();
        }
예제 #2
0
        public void TrackDurationTest()
        {
            var playerMock    = new Mock <IMixMediaPlayerService>();
            var telemetryMock = new Mock <ITelemetry>();

            var    tracker = new PlayerTelemetryTracker(playerMock.Object, telemetryMock.Object);
            string result  = tracker.TrackDuration(DateTimeOffset.Now);

            Assert.Equal(string.Empty, result);
        }