public async void PostsIssueOnUnhandlederror() { // create temp file var tmpFile = _fs.GetTempFilePath(); // launch test client that watches the file var proc = TestClient.Run(tmpFile); var list = await _errors.List(ErrorState.NeedsReview, new CancellationToken()); var origCount = list.Count; // trigger error by deleting watched file await Task.Delay(1000 * 5); await _fs.Delete(tmpFile); // wait a while for issue to be posted await Task.Delay(1000 * 8); // # of error issues should be plus one list = await _errors.List(ErrorState.NeedsReview, new CancellationToken()); list.Should().HaveCount(origCount + 1); var issue = list.Last(); // error msg should contain the filename issue.Description.Should().Contain(tmpFile); proc.Kill(); }
public async void CanPOSTIssues() { var ok = await _client.EnableWriteAccess(_creds); ok.Should().BeTrue("Can write"); var list = await _sut.List(ErrorState.NeedsReview, new CancellationToken()); var origCount = list.Count; var tkt = GetSampleTicket(); _sut.Post(tkt); await Task.Delay(1000 * 5); list = await _sut.List(ErrorState.NeedsReview, new CancellationToken()); list.Should().HaveCount(origCount + 1); }