Exemplo n.º 1
0
        protected virtual void VerifyEventTracking(Times times)
        {
            Analytics.TrackEvent(Actions.New, Categories.NodeOperations, "New Node", 5);
            clientMoq.Verify(c => c.TrackEvent(Actions.New, Categories.NodeOperations, "New Node", 5), times);

            Analytics.TrackScreenView("TestScreen");
            clientMoq.Verify(c => c.TrackScreenView("TestScreen"), times);

            TestAnalytics.TrackException <InvalidOperationException>(false);
            clientMoq.Verify(c => c.TrackException(It.IsAny <InvalidOperationException>(), false), times);

            var time        = TimeSpan.FromMinutes(3);
            var variable    = "TimeVariable";
            var description = "Some description";

            Analytics.TrackTimedEvent(Categories.Stability, variable, time, description);
            clientMoq.Verify(c => c.TrackTimedEvent(Categories.Stability, variable, time, description), times);

            using (var x = Analytics.CreateTimedEvent(Categories.Performance, variable, description))
            {
                clientMoq.Verify(c => c.CreateTimedEvent(Categories.Performance, variable, description, null), times);
            }

            var e = Analytics.TrackCommandEvent("TestCommand");

            clientMoq.Verify(c => c.CreateCommandEvent("TestCommand", "", null), times);

            e = Analytics.TrackFileOperationEvent(this.TempFolder, Actions.Read, 5);
            clientMoq.Verify(c => c.TrackFileOperationEvent(this.TempFolder, Actions.Read, 5, ""), times);

            Analytics.LogPiiInfo("tag", "data");
            clientMoq.Verify(c => c.LogPiiInfo("tag", "data"), times);
        }
Exemplo n.º 2
0
        public override void Setup()
        {
            base.Setup();

            clientMoq = MockClient();
            //Setup mock client and start analytics tracking.
            TestAnalytics.Init(clientMoq.Object, CurrentDynamoModel);
        }
Exemplo n.º 3
0
 public void EventTrackingDisabled()
 {
     TestAnalytics.Disable(); //Disable analytics tracking.
     VerifyEventTracking(Times.Never());
 }