/// <summary> /// This will be called on a background thread to read the results of the test from the /// named pipe client stream. /// </summary> /// <returns></returns> private void GoOnBackground(CancellationToken cancellationToken) { while (!cancellationToken.IsCancellationRequested) { try { var kind = _reader.ReadKind(); if (kind != TestDataKind.Value) { break; } var value = _readValue(_reader); _queue.Enqueue(value); } catch { // TODO: Happens when the connection unexpectedly closes on us. Need to surface this // to the user. break; } } // Signal we are done _queue.Enqueue(null); }
/// <summary> /// Read out the set of test case display names to run. /// </summary> private static List <string> ReadTestCaseDisplayNames(Stream stream) { using (var reader = new ClientReader(stream)) { var list = new List <string>(); while (reader.ReadKind() == TestDataKind.Value) { list.Add(reader.ReadString()); } return(list); } }
/// <summary> /// Read out the set of test case display names to run. /// </summary> private static List<string> ReadTestCaseDisplayNames(Stream stream) { using (var reader = new ClientReader(stream)) { var list = new List<string>(); while (reader.ReadKind() == TestDataKind.Value) { list.Add(reader.ReadString()); } return list; } }