1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.Collections.Generic;
6
using ICSharpCode.SharpDevelop.Gui;
7
using ICSharpCode.SharpDevelop.Project;
8
using ICSharpCode.UnitTesting;
10
namespace UnitTesting.Tests.Utils
12
public class DerivedRunTestCommand : AbstractRunTestCommand
14
public bool IsOnBeforeBuildMethodCalled;
15
public bool IsOnAfterRunTestsMethodCalled;
16
public AbstractRunTestCommand RunningTestCommandPropertyWhenOnBeforeBuildCalled;
17
public bool IsRunningTestWhenOnBeforeBuildCalled;
18
public bool IsOnStopMethodCalled;
19
public List<MockTestRunner> TestRunnersCreated = new List<MockTestRunner>();
20
public int OnBeforeRunTestsMethodCallCount;
22
public DerivedRunTestCommand(IRunTestCommandContext context)
27
public void CallOnBeforeBuildMethod()
32
protected override void OnBeforeBuild()
34
IsOnBeforeBuildMethodCalled = true;
35
RunningTestCommandPropertyWhenOnBeforeBuildCalled = AbstractRunTestCommand.RunningTestCommand;
36
IsRunningTestWhenOnBeforeBuildCalled = AbstractRunTestCommand.IsRunningTest;
39
protected override ITestRunner CreateTestRunner(IProject project)
41
MockTestRunner testRunner = new MockTestRunner();
42
TestRunnersCreated.Add(testRunner);
46
protected override void OnStop()
48
IsOnStopMethodCalled = true;
51
public Action<TestResult> ShowResultAction {
52
get { return ShowResult; }
55
public void CallTestsCompleted()
57
base.TestRunCompleted();
60
public void CallOnAfterRunTestsMethod()
65
protected override void OnAfterRunTests()
67
IsOnAfterRunTestsMethodCalled = true;
70
public ITestRunner CallCreateTestRunner(IProject project)
72
return CreateTestRunner(project);
75
protected override void OnBeforeRunTests()
77
OnBeforeRunTestsMethodCallCount++;