You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
58 lines
1.7 KiB
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) |
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) |
|
|
|
using System; |
|
using System.Collections.Generic; |
|
using ICSharpCode.SharpDevelop; |
|
using ICSharpCode.SharpDevelop.Gui; |
|
using ICSharpCode.UnitTesting; |
|
|
|
namespace UnitTesting.Tests.Utils |
|
{ |
|
public class MockTaskService : IUnitTestTaskService |
|
{ |
|
public bool IsClearExceptCommentTasksMethodCalled; |
|
public bool IsInUpdateWhilstClearExceptCommentTasksMethodCalled; |
|
public List<SDTask> Tasks = new List<SDTask>(); |
|
public bool HasCriticalErrorsReturnValue; |
|
public bool TreatWarningsAsErrorsParameterPassedToHasCriticalErrors; |
|
|
|
bool somethingWentWrong; |
|
bool inUpdate; |
|
MessageViewCategory buildMessageViewCategory = new MessageViewCategory("Build"); |
|
|
|
public bool SomethingWentWrong { |
|
get { return somethingWentWrong; } |
|
set { somethingWentWrong = value; } |
|
} |
|
|
|
public bool InUpdate { |
|
get { return inUpdate; } |
|
set { inUpdate = value; } |
|
} |
|
|
|
public MessageViewCategory BuildMessageViewCategory { |
|
get { return buildMessageViewCategory; } |
|
} |
|
|
|
public void ClearExceptCommentTasks() |
|
{ |
|
IsClearExceptCommentTasksMethodCalled = true; |
|
IsInUpdateWhilstClearExceptCommentTasksMethodCalled = inUpdate; |
|
} |
|
|
|
public void Add(SDTask task) |
|
{ |
|
if ((task.TaskType == TaskType.Error) || (task.TaskType == TaskType.Warning)) { |
|
SomethingWentWrong = true; |
|
} |
|
Tasks.Add(task); |
|
} |
|
|
|
public bool HasCriticalErrors(bool treatWarningsAsErrors) |
|
{ |
|
TreatWarningsAsErrorsParameterPassedToHasCriticalErrors = treatWarningsAsErrors; |
|
return HasCriticalErrorsReturnValue; |
|
} |
|
} |
|
}
|
|
|