コード例 #1
0
ファイル: TestMainView.cs プロジェクト: Astak/HangBreaker
 public void WaitFor(int seconds)
 {
     for (int i = 0; i < seconds; i++)
     {
         TimerAction.Execute();
     }
 }
コード例 #2
0
        public async Task Execute_Should_UpdateStorageStatus_If_StatusChanged()
        {
            //Arrange
            var siteId   = Guid.NewGuid();
            var siteUri  = new Uri($"http://{siteId}");
            var siteInfo = new SiteInfoEntity(siteId, siteUri, RefreshPeriod.FromSeconds(3));

            siteInfo.SetStatus(SiteStatus.Offline);

            _siteStorageMock.Setup(x => x.GetSiteInfo(siteId)).ReturnsAsync(siteInfo);
            _siteStatusCheckerMock.Setup(x => x.GetStatus(siteUri)).ReturnsAsync(StatusCheckResult.Success);

            //Act
            await _target.Execute(siteId, siteUri);

            //Assert
            _siteStorageMock.Verify(x => x.UpdateStatus(siteId, SiteStatus.Online), Times.Once);
        }