14 changed files with 164 additions and 34 deletions
@ -0,0 +1,22 @@ |
|||||||
|
// 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; |
||||||
|
|
||||||
|
namespace ICSharpCode.PackageManagement.Scripting |
||||||
|
{ |
||||||
|
public class ClearPackageManagementConsoleHostCommand |
||||||
|
{ |
||||||
|
IPackageManagementConsoleHost consoleHost; |
||||||
|
|
||||||
|
public ClearPackageManagementConsoleHostCommand(IPackageManagementConsoleHost consoleHost) |
||||||
|
{ |
||||||
|
this.consoleHost = consoleHost; |
||||||
|
} |
||||||
|
|
||||||
|
public void ClearHost() |
||||||
|
{ |
||||||
|
consoleHost.Clear(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,33 @@ |
|||||||
|
// 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 ICSharpCode.PackageManagement.Scripting; |
||||||
|
using NUnit.Framework; |
||||||
|
using PackageManagement.Tests.Helpers; |
||||||
|
|
||||||
|
namespace PackageManagement.Tests.Scripting |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class ClearPackageManagementConsoleHostCommandTests |
||||||
|
{ |
||||||
|
ClearPackageManagementConsoleHostCommand command; |
||||||
|
FakePackageManagementConsoleHost fakeConsoleHost; |
||||||
|
|
||||||
|
void CreateCommand() |
||||||
|
{ |
||||||
|
fakeConsoleHost = new FakePackageManagementConsoleHost(); |
||||||
|
command = new ClearPackageManagementConsoleHostCommand(fakeConsoleHost); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ClearHost_MethodCalled_ClearsConsoleHost() |
||||||
|
{ |
||||||
|
CreateCommand(); |
||||||
|
command.ClearHost(); |
||||||
|
|
||||||
|
bool called = fakeConsoleHost.IsClearCalled; |
||||||
|
Assert.IsTrue(called); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue