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);
 }
Exemple #3
0
 public bool CreateDynamicElement(RemoteTask remoteTask)
 {
     Add(TaskMessage.CreateDynamicElement(remoteTask));
     return(true);
 }
Exemple #4
0
 public bool TaskFinished(RemoteTask remoteTask, string message, TaskResult result)
 {
     Add(TaskMessage.TaskFinished(remoteTask, message, result));
     return(true);
 }
Exemple #5
0
 public bool TaskExplain(RemoteTask remoteTask, string explanation)
 {
     Add(TaskMessage.TaskExplain(remoteTask, explanation));
     return(true);
 }
Exemple #6
0
 public bool TaskOutput(RemoteTask remoteTask, string text, TaskOutputType outputType)
 {
     Add(TaskMessage.TaskOutput(remoteTask, text, outputType));
     return(true);
 }
Exemple #7
0
 public bool TaskException(RemoteTask remoteTask, TaskException[] exceptions)
 {
     Add(TaskMessage.TaskException(remoteTask, exceptions));
     ReportExceptions(exceptions);
     return(true);
 }
Exemple #8
0
 public bool TaskError(RemoteTask remoteTask, string message)
 {
     Add(TaskMessage.TaskError(remoteTask, message));
     return(true);
 }
Exemple #9
0
 public bool TaskProgress(RemoteTask remoteTask, string message)
 {
     Add(TaskMessage.TaskProgress(remoteTask, message));
     return(true);
 }
Exemple #10
0
 public bool TaskStarting(RemoteTask remoteTask)
 {
     Add(TaskMessage.TaskStarting(remoteTask));
     return(true);
 }