Exemple #1
0
        public async Task SendHitTest()
        {
            var defaultStrategy = new DefaultStrategy(visitorDelegate);
            var hit             = new Flagship.Hit.Screen("HomeView");
            await defaultStrategy.SendHit(hit).ConfigureAwait(false);

            trackingManagerMock.Verify(x => x.SendHit(hit), Times.Once());
        }
Exemple #2
0
        public async Task SendHitNotReadyTest()
        {
            const string functionName    = "SendHit";
            var          defaultStrategy = new DefaultStrategy(visitorDelegate);
            var          hit             = new Flagship.Hit.Screen(null);
            await defaultStrategy.SendHit(hit).ConfigureAwait(false);

            fsLogManagerMock.Verify(x => x.Error(hit.GetErrorMessage(), functionName), Times.Once());
        }
Exemple #3
0
        public async Task SendHitsTest()
        {
            var defaultStrategy = new DefaultStrategy(visitorDelegate);
            var screen          = new Flagship.Hit.Screen("HomeView");
            var page            = new Flagship.Hit.Page("HomePage");
            await defaultStrategy.SendHit(new List <Hit.HitAbstract>() { screen, page }).ConfigureAwait(false);

            trackingManagerMock.Verify(x => x.SendHit(screen), Times.Once());
            trackingManagerMock.Verify(x => x.SendHit(page), Times.Once());
        }
Exemple #4
0
        public async Task SendHitFailedTest()
        {
            const string functionName    = "SendHit";
            var          errorMessage    = "error hit";
            var          defaultStrategy = new DefaultStrategy(visitorDelegate);
            var          hit             = new Flagship.Hit.Screen("HomeView");

            trackingManagerMock.Setup(x => x.SendHit(hit)).Throws(new Exception(errorMessage));

            await defaultStrategy.SendHit(hit).ConfigureAwait(false);

            trackingManagerMock.Verify(x => x.SendHit(hit), Times.Once());

            fsLogManagerMock.Verify(x => x.Error(errorMessage, functionName), Times.Once());
        }