public void SendUserStatistics_HttpHandlerPostAsyncRecivesOneCall()
        {
            var job      = BuildJob();
            var duration = TimeSpan.MaxValue;
            var status   = "test status";

            _usageStatisticsManager.EnableUsageStatistics = true;
            _usageStatisticsManager.SendUsageStatistics(duration, job, status);

            _usageStatisticsSender.Received(1).SendAsync(Arg.Any <IUsageMetric>());
        }
        public void SendPdfCreatorStatistics_UsageStatisticsIsEnabled_HttpHandlerPostReceivesOneCall()
        {
            var job = BuildJob();

            _settingsProvider.Settings.ApplicationSettings.UsageStatistics.Enable = true;

            _threadManager.When(x => x.StartSynchronizedThread(Arg.Any <ISynchronizedThread>()))
            .Do(info =>
            {
                var t = info.Arg <ISynchronizedThread>();
                t.Start();
                t.Join();
            });

            _pdfCreatorUsageStatisticsManager.SendUsageStatistics(_duration, job, _status);
            _usageStatisticsSender.Received(1).Send(Arg.Any <IUsageMetric>());
        }