public static void AssertOrderedSubsetWithSameTasks(this IEnumerable<TaskMessage> taskMessages, TaskMessage[] expectedMessages) { int i = 0; using (var enumerator = taskMessages.GetEnumerator()) { while (enumerator.MoveNext() && i < expectedMessages.Length) { var taskMessage = enumerator.Current; if (taskMessage != null && Equals(taskMessage.Task, expectedMessages[i].Task) && taskMessage.Task.Id == expectedMessages[i].Task.Id && taskMessage.Message == expectedMessages[i].Message) i++; } if (i < expectedMessages.Length) throw new AssertException(string.Format("Could not find message: {0} - {1}", expectedMessages[i].Task, expectedMessages[i].Message)); } }
protected void Add(TaskMessage message) { Console.WriteLine(message); messages.Add(message); }
public bool CreateDynamicElement(RemoteTask remoteTask) { Add(TaskMessage.CreateDynamicElement(remoteTask)); return(true); }
public bool TaskFinished(RemoteTask remoteTask, string message, TaskResult result) { Add(TaskMessage.TaskFinished(remoteTask, message, result)); return(true); }
public bool TaskExplain(RemoteTask remoteTask, string explanation) { Add(TaskMessage.TaskExplain(remoteTask, explanation)); return(true); }
public bool TaskOutput(RemoteTask remoteTask, string text, TaskOutputType outputType) { Add(TaskMessage.TaskOutput(remoteTask, text, outputType)); return(true); }
public bool TaskException(RemoteTask remoteTask, TaskException[] exceptions) { Add(TaskMessage.TaskException(remoteTask, exceptions)); ReportExceptions(exceptions); return(true); }
public bool TaskError(RemoteTask remoteTask, string message) { Add(TaskMessage.TaskError(remoteTask, message)); return(true); }
public bool TaskProgress(RemoteTask remoteTask, string message) { Add(TaskMessage.TaskProgress(remoteTask, message)); return(true); }
public bool TaskStarting(RemoteTask remoteTask) { Add(TaskMessage.TaskStarting(remoteTask)); return(true); }