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.6 KiB
58 lines
1.6 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.Diagnostics; |
|
using ICSharpCode.Core; |
|
using ICSharpCode.PythonBinding; |
|
using ICSharpCode.Scripting.Tests.Utils; |
|
using ICSharpCode.SharpDevelop.Debugging; |
|
using NUnit.Framework; |
|
using PythonBinding.Tests.Utils; |
|
|
|
namespace PythonBinding.Tests.Gui |
|
{ |
|
[TestFixture] |
|
public class DebugPythonCommandTestFixture |
|
{ |
|
MockDebugger debugger; |
|
RunDebugPythonCommand command; |
|
|
|
[TestFixtureSetUp] |
|
public void SetUpFixture() |
|
{ |
|
MockWorkbench workbench = MockWorkbench.CreateWorkbenchWithOneViewContent(@"C:\Projects\test.py"); |
|
|
|
Properties p = new Properties(); |
|
PythonAddInOptions options = new PythonAddInOptions(p); |
|
options.PythonFileName = @"C:\IronPython\ipy.exe"; |
|
|
|
debugger = new MockDebugger(); |
|
command = new RunDebugPythonCommand(workbench, options, debugger); |
|
command.Run(); |
|
} |
|
|
|
[Test] |
|
public void Run_PythonFileOpen_DebuggerStartMethodCalled() |
|
{ |
|
bool result = debugger.StartMethodCalled; |
|
Assert.IsTrue(result); |
|
} |
|
|
|
[Test] |
|
public void Run_PythonFileOpen_IronPythonConsoleFileNamePassedToDebugger() |
|
{ |
|
string fileName = debugger.ProcessStartInfo.FileName; |
|
string expectedFileName = @"C:\IronPython\ipy.exe"; |
|
Assert.AreEqual(expectedFileName, fileName); |
|
} |
|
|
|
[Test] |
|
public void Run_PythonFileOpen_DebugOptionsPassedToIronPythonConsole() |
|
{ |
|
string args = debugger.ProcessStartInfo.Arguments; |
|
string expectedArgs = "-X:Debug \"test.py\""; |
|
Assert.AreEqual(expectedArgs, args); |
|
} |
|
} |
|
}
|
|
|