private async Task SetSessionStateAsync(TestRunSessionState state) { var sessionPatch = new JsonPatchDocument <TestRunSessionRequest>(); sessionPatch.Add(s => s.State, state); var newSession = await _client.PatchTestRunSessionAsync(_session.Id, sessionPatch); _logger.Debug("Session state updated to " + newSession.State); _session.State = newSession.State; }
public async Task RecordTestSessionEndAsync(TestRunSessionState state) { var sessionPatch = new JsonPatchDocument <TestRunSessionRequest>(); sessionPatch.Add(s => s.State, state); sessionPatch.Add(s => s.FinishTime, DateTime.Now); var response = await _client.PatchTestRunSessionAsync(_session.Id, sessionPatch); _session.State = response.State; _session.FinishTime = response.FinishTime; LogDebug("Test session finished:", response); }