Пример #1
0
        public async Task Should_Poll_For_Initialized()
        {
            var times          = 5;
            var initializeWait = 1000;

            fccEngine.InitializeWait = initializeWait;

            var mockInitializeStatusProvider = new Mock <IInitializeStatusProvider>();

            mockInitializeStatusProvider.SetupProperty(i => i.InitializeStatus);
            var initializeStatusProvider = mockInitializeStatusProvider.Object;

            fccEngine.Initialize(initializeStatusProvider, CancellationToken.None);

            fccEngine.ReloadCoverage(() => Task.FromResult(new List <ICoverageProject>()));
            await Task.Delay(times *initializeWait).ContinueWith(_ =>
            {
                initializeStatusProvider.InitializeStatus = InitializeStatus.Initialized;
            });

            await fccEngine.reloadCoverageTask;

            mocker.Verify <ILogger>(l => l.Log(fccEngine.GetLogReloadCoverageStatusMessage(ReloadCoverageStatus.Initializing)), Times.AtLeast(times));
        }
Пример #2
0
 private void VerifyLogsReloadCoverageStatus(ReloadCoverageStatus reloadCoverageStatus)
 {
     mocker.Verify <ILogger>(l => l.Log(fccEngine.GetLogReloadCoverageStatusMessage(reloadCoverageStatus)));
 }