Browse Source

Move file service code in IronPython and IronRuby addins to common Scripting project.

pull/1/head
mrward 16 years ago
parent
commit
7767977b32
  1. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj
  2. 23
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonFileService.cs
  3. 38
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFileService.cs
  4. 7
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestDebugger.cs
  5. 6
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunner.cs
  6. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerApplication.cs
  7. 11
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerContext.cs
  8. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
  9. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestDebuggerRunsSelectedTestMethodTestFixture.cs
  10. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestRunnerRunsSelectedTestMethodTestFixture.cs
  11. 65
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockPythonFileService.cs
  12. 67
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/MockPythonFileServiceTestFixture.cs
  13. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj
  14. 7
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestDebugger.cs
  15. 6
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunner.cs
  16. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerApplication.cs
  17. 9
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerContext.cs
  18. 3
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj
  19. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs
  20. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs
  21. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs
  22. 7
      src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj
  23. 5
      src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingFileService.cs
  24. 5
      src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingFileService.cs
  25. 6
      src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj
  26. 5
      src/AddIns/BackendBindings/Scripting/Test/Utils/MockScriptingFileService.cs
  27. 9
      src/AddIns/BackendBindings/Scripting/Test/Utils/Tests/MockScriptingFileServiceTests.cs

2
src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj

@ -90,7 +90,6 @@ @@ -90,7 +90,6 @@
<Compile Include="Src\CompilingOptionsPanel.cs" />
<Compile Include="Src\IPythonConsole.cs" />
<Compile Include="Src\IPythonConsolePad.cs" />
<Compile Include="Src\IPythonFileService.cs" />
<Compile Include="Src\IPythonResolver.cs" />
<Compile Include="Src\IPythonWorkbench.cs" />
<Compile Include="Src\MemberName.cs" />
@ -98,7 +97,6 @@ @@ -98,7 +97,6 @@
<Compile Include="Src\PythonClassResolver.cs" />
<Compile Include="Src\PythonConsoleApplication.cs" />
<Compile Include="Src\PythonDotNetMethodResolver.cs" />
<Compile Include="Src\PythonFileService.cs" />
<Compile Include="Src\PythonFromImport.cs" />
<Compile Include="Src\PythonImport.cs" />
<Compile Include="Src\PythonLanguageBinding.cs" />

23
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonFileService.cs

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Text;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.PythonBinding
{
public interface IPythonFileService : IFileSystem
{
string GetTempFileName();
TextWriter CreateTextWriter(CreateTextWriterInfo createTextWriterInfo);
void DeleteFile(string fileName);
}
}

38
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFileService.cs

@ -1,38 +0,0 @@ @@ -1,38 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Text;
using ICSharpCode.Scripting;
namespace ICSharpCode.PythonBinding
{
public class PythonFileService : IPythonFileService
{
public string GetTempFileName()
{
return Path.GetTempFileName();
}
public TextWriter CreateTextWriter(CreateTextWriterInfo createTextWriterInfo)
{
return createTextWriterInfo.CreateTextWriter();
}
public void DeleteFile(string fileName)
{
File.Delete(fileName);
}
public bool FileExists(string fileName)
{
return File.Exists(fileName);
}
}
}

7
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestDebugger.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.Diagnostics;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.PythonBinding
@ -14,7 +15,7 @@ namespace ICSharpCode.PythonBinding @@ -14,7 +15,7 @@ namespace ICSharpCode.PythonBinding
public class PythonTestDebugger : TestDebuggerBase
{
PythonAddInOptions options;
IPythonFileService fileService;
IScriptingFileService fileService;
PythonTestRunnerApplication testRunnerApplication;
PythonStandardLibraryPath pythonStandardLibraryPath;
@ -24,7 +25,7 @@ namespace ICSharpCode.PythonBinding @@ -24,7 +25,7 @@ namespace ICSharpCode.PythonBinding
new TestResultsMonitor(),
new PythonAddInOptions(),
new PythonStandardLibraryPath(),
new PythonFileService())
new ScriptingFileService())
{
}
@ -33,7 +34,7 @@ namespace ICSharpCode.PythonBinding @@ -33,7 +34,7 @@ namespace ICSharpCode.PythonBinding
ITestResultsMonitor testResultsMonitor,
PythonAddInOptions options,
PythonStandardLibraryPath pythonStandardLibraryPath,
IPythonFileService fileService)
IScriptingFileService fileService)
: base(debuggerService, messageService, testResultsMonitor)
{
this.options = options;

6
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunner.cs

@ -9,8 +9,10 @@ using System; @@ -9,8 +9,10 @@ using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.Core.Services;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.PythonBinding
@ -19,7 +21,7 @@ namespace ICSharpCode.PythonBinding @@ -19,7 +21,7 @@ namespace ICSharpCode.PythonBinding
{
PythonAddInOptions options;
PythonStandardLibraryPath pythonStandardLibraryPath;
IPythonFileService fileService;
IScriptingFileService fileService;
PythonTestRunnerApplication testRunnerApplication;
public PythonTestRunner()
@ -32,7 +34,7 @@ namespace ICSharpCode.PythonBinding @@ -32,7 +34,7 @@ namespace ICSharpCode.PythonBinding
{
this.options = context.Options;
this.pythonStandardLibraryPath = context.PythonStandardLibraryPath;
this.fileService = context.PythonFileService;
this.fileService = context.ScriptingFileService;
}
public override void Start(SelectedTests selectedTests)

4
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerApplication.cs

@ -22,14 +22,14 @@ namespace ICSharpCode.PythonBinding @@ -22,14 +22,14 @@ namespace ICSharpCode.PythonBinding
PythonAddInOptions options;
PythonStandardLibraryPath pythonStandardLibraryPath;
PythonTestRunnerResponseFile responseFile;
IPythonFileService fileService;
IScriptingFileService fileService;
CreateTextWriterInfo textWriterInfo;
PythonConsoleApplication consoleApplication;
public PythonTestRunnerApplication(string testResultsFileName,
PythonAddInOptions options,
PythonStandardLibraryPath pythonStandardLibraryPath,
IPythonFileService fileService)
IScriptingFileService fileService)
{
this.testResultsFileName = testResultsFileName;
this.options = options;

11
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerContext.cs

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
// </file>
using System;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.PythonBinding
@ -14,14 +15,14 @@ namespace ICSharpCode.PythonBinding @@ -14,14 +15,14 @@ namespace ICSharpCode.PythonBinding
{
PythonAddInOptions options;
PythonStandardLibraryPath pythonStandardLibraryPath;
IPythonFileService fileService;
IScriptingFileService fileService;
public PythonTestRunnerContext(IUnitTestProcessRunner processRunner,
ITestResultsMonitor testResultsMonitor,
IUnitTestMessageService messageService,
PythonAddInOptions options,
PythonStandardLibraryPath pythonStandardLibraryPath,
IPythonFileService fileService)
IScriptingFileService fileService)
: base(processRunner, testResultsMonitor, fileService, messageService)
{
this.options = options;
@ -35,7 +36,7 @@ namespace ICSharpCode.PythonBinding @@ -35,7 +36,7 @@ namespace ICSharpCode.PythonBinding
new UnitTestMessageService(),
new PythonAddInOptions(),
new PythonStandardLibraryPath(),
new PythonFileService())
new ScriptingFileService())
{
}
@ -47,8 +48,8 @@ namespace ICSharpCode.PythonBinding @@ -47,8 +48,8 @@ namespace ICSharpCode.PythonBinding
get { return pythonStandardLibraryPath; }
}
public IPythonFileService PythonFileService {
get { return base.FileSystem as IPythonFileService; }
public IScriptingFileService ScriptingFileService {
get { return base.FileSystem as IScriptingFileService; }
}
}
}

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj

@ -438,7 +438,6 @@ @@ -438,7 +438,6 @@
<Compile Include="Utils\MockDesignerGenerator.cs" />
<Compile Include="Utils\MockPythonConsole.cs" />
<Compile Include="Utils\MockPythonConsolePad.cs" />
<Compile Include="Utils\MockPythonFileService.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\PythonMSBuildEngineHelper.cs" />
<Compile Include="Utils\TestablePythonConsole.cs" />
@ -450,7 +449,6 @@ @@ -450,7 +449,6 @@
<Compile Include="Utils\PythonBindingAddInFile.cs" />
<Compile Include="Utils\PythonCompletionItemsHelper.cs" />
<Compile Include="Utils\PythonParserHelper.cs" />
<Compile Include="Utils\Tests\MockPythonFileServiceTestFixture.cs" />
<Compile Include="Utils\Tests\PythonCompletionItemsHelperTests.cs" />
<Compile Include="Utils\Tests\PythonParserHelperTests.cs" />
<EmbeddedResource Include="Designer\App.ico" />

4
src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestDebuggerRunsSelectedTestMethodTestFixture.cs

@ -33,7 +33,7 @@ namespace PythonBinding.Tests.Testing @@ -33,7 +33,7 @@ namespace PythonBinding.Tests.Testing
SelectedTests selectedTests;
MockMethod methodToTest;
PythonAddInOptions options;
MockPythonFileService fileService;
MockScriptingFileService fileService;
StringBuilder responseFileText;
StringWriter responseFileStringWriter;
PythonStandardLibraryPath standardLibraryPath;
@ -54,7 +54,7 @@ namespace PythonBinding.Tests.Testing @@ -54,7 +54,7 @@ namespace PythonBinding.Tests.Testing
options = new PythonAddInOptions(new Properties());
options.PythonFileName = @"c:\ironpython\ipy.exe";
standardLibraryPath = new PythonStandardLibraryPath(@"c:\python\lib");
fileService = new MockPythonFileService();
fileService = new MockScriptingFileService();
testDebugger = new PythonTestDebugger(debuggerService, messageService, testResultsMonitor, options, standardLibraryPath, fileService);
}

4
src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestRunnerRunsSelectedTestMethodTestFixture.cs

@ -32,7 +32,7 @@ namespace PythonBinding.Tests.Testing @@ -32,7 +32,7 @@ namespace PythonBinding.Tests.Testing
SelectedTests selectedTests;
MockMethod methodToTest;
PythonAddInOptions options;
MockPythonFileService fileService;
MockScriptingFileService fileService;
StringBuilder responseFileText;
StringWriter responseFileStringWriter;
PythonStandardLibraryPath standardLibraryPath;
@ -51,7 +51,7 @@ namespace PythonBinding.Tests.Testing @@ -51,7 +51,7 @@ namespace PythonBinding.Tests.Testing
testResultsMonitor = new MockTestResultsMonitor();
options = new PythonAddInOptions(new Properties());
options.PythonFileName = @"c:\ironpython\ipy.exe";
fileService = new MockPythonFileService();
fileService = new MockScriptingFileService();
messageService = new MockMessageService();
standardLibraryPath = new PythonStandardLibraryPath(@"c:\python\lib");
PythonTestRunnerContext context = new PythonTestRunnerContext(processRunner,

65
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockPythonFileService.cs

@ -1,65 +0,0 @@ @@ -1,65 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Text;
using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting;
namespace PythonBinding.Tests.Utils
{
public class MockPythonFileService : IPythonFileService
{
CreateTextWriterInfo createTextWriterInfoPassedToCreateTextWriter;
string tempFileName;
TextWriter textWriter;
string fileNameDeleted;
public void SetTempFileName(string fileName)
{
this.tempFileName = fileName;
}
public string GetTempFileName()
{
return tempFileName;
}
public void SetTextWriter(TextWriter writer)
{
this.textWriter = writer;
}
public TextWriter CreateTextWriter(CreateTextWriterInfo textWriterInfo)
{
createTextWriterInfoPassedToCreateTextWriter = textWriterInfo;
return textWriter;
}
public CreateTextWriterInfo CreateTextWriterInfoPassedToCreateTextWriter {
get { return createTextWriterInfoPassedToCreateTextWriter; }
set { createTextWriterInfoPassedToCreateTextWriter = value; }
}
public void DeleteFile(string fileName)
{
fileNameDeleted = fileName;
}
public string FileNameDeleted {
get { return fileNameDeleted; }
set { fileNameDeleted = value; }
}
public bool FileExists(string fileName)
{
return true;
}
}
}

67
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/MockPythonFileServiceTestFixture.cs

@ -1,67 +0,0 @@ @@ -1,67 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Text;
using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting;
using NUnit.Framework;
namespace PythonBinding.Tests.Utils.Tests
{
[TestFixture]
public class MockPythonFileServiceTestFixture
{
MockPythonFileService fileService;
[SetUp]
public void Init()
{
fileService = new MockPythonFileService();
}
[Test]
public void GetTempFileNameReturnsReturnsTemporaryFileName()
{
string expectedFileName = @"c:\temp\tmp1.tmp";
fileService.SetTempFileName(expectedFileName);
string tempFileName = fileService.GetTempFileName();
Assert.AreEqual(expectedFileName, tempFileName);
}
[Test]
public void TextWriterReturnedFromCreateTextWriter()
{
using (StringWriter stringWriter = new StringWriter(new StringBuilder())) {
fileService.SetTextWriter(stringWriter);
CreateTextWriterInfo info = new CreateTextWriterInfo(@"test.tmp", Encoding.UTF8, true);
Assert.AreEqual(stringWriter, fileService.CreateTextWriter(info));
}
}
[Test]
public void CreateTextWriterInfoIsSavedWhenCreateTextWriterMethodIsCalled()
{
fileService.CreateTextWriterInfoPassedToCreateTextWriter = null;
CreateTextWriterInfo info = new CreateTextWriterInfo("test.txt", Encoding.UTF8, true);
fileService.CreateTextWriter(info);
Assert.AreEqual(info, fileService.CreateTextWriterInfoPassedToCreateTextWriter);
}
[Test]
public void DeleteFileSavesFileNameDeleted()
{
fileService.FileNameDeleted = null;
string expectedFileName = @"c:\temp\tmp66.tmp";
fileService.DeleteFile(expectedFileName);
Assert.AreEqual(expectedFileName, fileService.FileNameDeleted);
}
}
}

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj

@ -88,7 +88,6 @@ @@ -88,7 +88,6 @@
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\IRubyConsole.cs" />
<Compile Include="Src\IRubyConsolePad.cs" />
<Compile Include="Src\IRubyFileService.cs" />
<Compile Include="Src\IRubyWorkbench.cs" />
<Compile Include="Src\RubyConsoleApplication.cs" />
<Compile Include="Src\ConvertProjectToRubyProjectCommand.cs" />
@ -110,7 +109,6 @@ @@ -110,7 +109,6 @@
<Compile Include="Src\RubyDesignerGenerator.cs" />
<Compile Include="Src\RubyDesignerLoader.cs" />
<Compile Include="Src\RubyDesignerLoaderProvider.cs" />
<Compile Include="Src\RubyFileService.cs" />
<Compile Include="Src\RubyFormattingStrategy.cs" />
<Compile Include="Src\RubyFormsDesignerDisplayBinding.cs" />
<Compile Include="Src\RubyLanguageBinding.cs" />

7
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestDebugger.cs

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
using System;
using System.Diagnostics;
using ICSharpCode.Core.Services;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.RubyBinding
@ -15,7 +16,7 @@ namespace ICSharpCode.RubyBinding @@ -15,7 +16,7 @@ namespace ICSharpCode.RubyBinding
public class RubyTestDebugger : TestDebuggerBase
{
RubyAddInOptions options;
IRubyFileService fileService;
IScriptingFileService fileService;
RubyTestRunnerApplication testRunnerApplication;
public RubyTestDebugger()
@ -23,7 +24,7 @@ namespace ICSharpCode.RubyBinding @@ -23,7 +24,7 @@ namespace ICSharpCode.RubyBinding
new UnitTestMessageService(),
new TestResultsMonitor(),
new RubyAddInOptions(),
new RubyFileService())
new ScriptingFileService())
{
}
@ -31,7 +32,7 @@ namespace ICSharpCode.RubyBinding @@ -31,7 +32,7 @@ namespace ICSharpCode.RubyBinding
IUnitTestMessageService messageService,
ITestResultsMonitor testResultsMonitor,
RubyAddInOptions options,
IRubyFileService fileService)
IScriptingFileService fileService)
: base(debuggerService, messageService, testResultsMonitor)
{
this.options = options;

6
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunner.cs

@ -9,7 +9,9 @@ using System; @@ -9,7 +9,9 @@ using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.RubyBinding
@ -17,7 +19,7 @@ namespace ICSharpCode.RubyBinding @@ -17,7 +19,7 @@ namespace ICSharpCode.RubyBinding
public class RubyTestRunner : TestProcessRunnerBase
{
RubyAddInOptions options;
IRubyFileService fileService;
IScriptingFileService fileService;
RubyTestRunnerApplication testRunnerApplication;
public RubyTestRunner()
@ -29,7 +31,7 @@ namespace ICSharpCode.RubyBinding @@ -29,7 +31,7 @@ namespace ICSharpCode.RubyBinding
: base(context)
{
this.options = context.Options;
this.fileService = context.RubyFileService;
this.fileService = context.ScriptingFileService;
context.TestResultsMonitor.InitialFilePosition = 0;
}

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerApplication.cs

@ -22,14 +22,14 @@ namespace ICSharpCode.RubyBinding @@ -22,14 +22,14 @@ namespace ICSharpCode.RubyBinding
string testResultsFileName = String.Empty;
RubyAddInOptions options;
RubyTestRunnerResponseFile responseFile;
IRubyFileService fileService;
IScriptingFileService fileService;
CreateTextWriterInfo textWriterInfo;
RubyConsoleApplication consoleApplication;
StringBuilder arguments;
public RubyTestRunnerApplication(string testResultsFileName,
RubyAddInOptions options,
IRubyFileService fileService)
IScriptingFileService fileService)
{
this.testResultsFileName = testResultsFileName;
this.options = options;

9
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerContext.cs

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
// </file>
using System;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.RubyBinding
@ -13,13 +14,13 @@ namespace ICSharpCode.RubyBinding @@ -13,13 +14,13 @@ namespace ICSharpCode.RubyBinding
public class RubyTestRunnerContext : TestProcessRunnerBaseContext
{
RubyAddInOptions options;
IRubyFileService fileService;
IScriptingFileService fileService;
public RubyTestRunnerContext()
: this(new UnitTestProcessRunner(),
new TestResultsMonitor(),
new RubyAddInOptions(),
new RubyFileService(),
new ScriptingFileService(),
new UnitTestMessageService())
{
}
@ -27,7 +28,7 @@ namespace ICSharpCode.RubyBinding @@ -27,7 +28,7 @@ namespace ICSharpCode.RubyBinding
public RubyTestRunnerContext(IUnitTestProcessRunner processRunner,
ITestResultsMonitor testResultsMonitor,
RubyAddInOptions options,
IRubyFileService fileService,
IScriptingFileService fileService,
IUnitTestMessageService messageService)
: base(processRunner, testResultsMonitor, fileService, messageService)
{
@ -39,7 +40,7 @@ namespace ICSharpCode.RubyBinding @@ -39,7 +40,7 @@ namespace ICSharpCode.RubyBinding
get { return options; }
}
public IRubyFileService RubyFileService {
public IScriptingFileService ScriptingFileService {
get { return fileService; }
}
}

3
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj

@ -332,14 +332,12 @@ @@ -332,14 +332,12 @@
<Compile Include="Utils\MockDesignerGenerator.cs" />
<Compile Include="Utils\MockRubyConsole.cs" />
<Compile Include="Utils\MockRubyConsolePad.cs" />
<Compile Include="Utils\MockRubyFileService.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\RubyBindingAddInFile.cs" />
<Compile Include="Utils\RubyMSBuildEngineHelper.cs" />
<Compile Include="Utils\RubyParserHelper.cs" />
<Compile Include="Utils\RubySelectedTestsHelper.cs" />
<Compile Include="Utils\TestableRubyConsole.cs" />
<Compile Include="Utils\Tests\MockRubyFileServiceTestFixture.cs" />
<EmbeddedResource Include="..\Project\RubyBinding.addin">
<Link>RubyBinding.addin</Link>
</EmbeddedResource>
@ -349,7 +347,6 @@ @@ -349,7 +347,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Testing" />
<Folder Include="Utils\Tests" />
<ProjectReference Include="..\..\..\..\..\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj">
<Project>{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}</Project>
<Name>ICSharpCode.AvalonEdit</Name>

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs

@ -33,7 +33,7 @@ namespace RubyBinding.Tests.Testing @@ -33,7 +33,7 @@ namespace RubyBinding.Tests.Testing
SelectedTests selectedTests;
MockMethod methodToTest;
RubyAddInOptions options;
MockRubyFileService fileService;
MockScriptingFileService fileService;
StringBuilder responseFileText;
StringWriter responseFileStringWriter;
@ -53,7 +53,7 @@ namespace RubyBinding.Tests.Testing @@ -53,7 +53,7 @@ namespace RubyBinding.Tests.Testing
testResultsMonitor.InitialFilePosition = 3;
options = new RubyAddInOptions(new Properties());
options.RubyFileName = @"c:\ironruby\ir.exe";
fileService = new MockRubyFileService();
fileService = new MockScriptingFileService();
testDebugger = new RubyTestDebugger(debuggerService, messageService, testResultsMonitor, options, fileService);
}

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs

@ -32,7 +32,7 @@ namespace RubyBinding.Tests.Testing @@ -32,7 +32,7 @@ namespace RubyBinding.Tests.Testing
public void Init()
{
string tempFileName = "temp.tmp";
MockRubyFileService fileService = new MockRubyFileService();
MockScriptingFileService fileService = new MockScriptingFileService();
fileService.SetTempFileName(tempFileName);
fileService.SetTextWriter(new StringWriter());

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs

@ -32,7 +32,7 @@ namespace RubyBinding.Tests.Testing @@ -32,7 +32,7 @@ namespace RubyBinding.Tests.Testing
SelectedTests selectedTests;
MockMethod methodToTest;
RubyAddInOptions options;
MockRubyFileService fileService;
MockScriptingFileService fileService;
StringBuilder responseFileText;
StringWriter responseFileStringWriter;
@ -50,7 +50,7 @@ namespace RubyBinding.Tests.Testing @@ -50,7 +50,7 @@ namespace RubyBinding.Tests.Testing
testResultsMonitor.InitialFilePosition = 3;
options = new RubyAddInOptions(new Properties());
options.RubyFileName = @"c:\ironruby\ir.exe";
fileService = new MockRubyFileService();
fileService = new MockScriptingFileService();
MockMessageService messageService = new MockMessageService();
RubyTestRunnerContext context = new RubyTestRunnerContext(processRunner, testResultsMonitor, options, fileService, messageService);

7
src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj

@ -70,10 +70,12 @@ @@ -70,10 +70,12 @@
<Compile Include="Src\ILock.cs" />
<Compile Include="Src\IMemberProvider.cs" />
<Compile Include="Src\IScriptingConsoleTextEditor.cs" />
<Compile Include="Src\IScriptingFileService.cs" />
<Compile Include="Src\ScriptingConsoleCompletionData.cs" />
<Compile Include="Src\ScriptingConsoleCompletionDataProvider.cs" />
<Compile Include="Src\ScriptingConsoleTextEditor.cs" />
<Compile Include="Src\ScriptingConsoleTextEditorKeyEventArgs.cs" />
<Compile Include="Src\ScriptingFileService.cs" />
<Compile Include="Src\StringListLock.cs" />
<Compile Include="Src\ThreadSafeScriptingConsoleTextEditor.cs" />
</ItemGroup>
@ -93,6 +95,11 @@ @@ -93,6 +95,11 @@
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\Analysis\UnitTesting\UnitTesting.csproj">
<Project>{1F261725-6318-4434-A1B1-6C70CE4CD324}</Project>
<Name>UnitTesting</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/IRubyFileService.cs → src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingFileService.cs

@ -9,12 +9,11 @@ using System; @@ -9,12 +9,11 @@ using System;
using System.IO;
using System.Text;
using ICSharpCode.Scripting;
using ICSharpCode.UnitTesting;
namespace ICSharpCode.RubyBinding
namespace ICSharpCode.Scripting
{
public interface IRubyFileService : IFileSystem
public interface IScriptingFileService : IFileSystem
{
string GetTempFileName();
TextWriter CreateTextWriter(CreateTextWriterInfo createTextWriterInfo);

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyFileService.cs → src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingFileService.cs

@ -8,11 +8,10 @@ @@ -8,11 +8,10 @@
using System;
using System.IO;
using System.Text;
using ICSharpCode.Scripting;
namespace ICSharpCode.RubyBinding
namespace ICSharpCode.Scripting
{
public class RubyFileService : IRubyFileService
public class ScriptingFileService : IScriptingFileService
{
public string GetTempFileName()
{

6
src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj

@ -110,6 +110,7 @@ @@ -110,6 +110,7 @@
<Compile Include="Utils\MockResourceReader.cs" />
<Compile Include="Utils\MockResourceService.cs" />
<Compile Include="Utils\MockResourceWriter.cs" />
<Compile Include="Utils\MockScriptingFileService.cs" />
<Compile Include="Utils\MockSite.cs" />
<Compile Include="Utils\MockTextEditor.cs" />
<Compile Include="Utils\MockTextEditorOptions.cs" />
@ -125,6 +126,7 @@ @@ -125,6 +126,7 @@
<Compile Include="Utils\Tests\MockControlDispatcherTestFixture.cs" />
<Compile Include="Utils\Tests\MockEditableViewContentTestFixture.cs" />
<Compile Include="Utils\Tests\MockProjectContentTests.cs" />
<Compile Include="Utils\Tests\MockScriptingFileServiceTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj">
@ -151,6 +153,10 @@ @@ -151,6 +153,10 @@
<Project>{44A8DE09-CAB9-49D8-9CFC-5EB0A552F181}</Project>
<Name>UnitTesting.Tests</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Analysis\UnitTesting\UnitTesting.csproj">
<Project>{1F261725-6318-4434-A1B1-6C70CE4CD324}</Project>
<Name>UnitTesting</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\DisplayBindings\FormsDesigner\Project\FormsDesigner.csproj">
<Project>{7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57}</Project>
<Name>FormsDesigner</Name>

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MockRubyFileService.cs → src/AddIns/BackendBindings/Scripting/Test/Utils/MockScriptingFileService.cs

@ -9,12 +9,11 @@ using System; @@ -9,12 +9,11 @@ using System;
using System.IO;
using System.Text;
using ICSharpCode.RubyBinding;
using ICSharpCode.Scripting;
namespace RubyBinding.Tests.Utils
namespace ICSharpCode.Scripting.Tests.Utils
{
public class MockRubyFileService : IRubyFileService
public class MockScriptingFileService : IScriptingFileService
{
CreateTextWriterInfo createTextWriterInfoPassedToCreateTextWriter;
string tempFileName;

9
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/Tests/MockRubyFileServiceTestFixture.cs → src/AddIns/BackendBindings/Scripting/Test/Utils/Tests/MockScriptingFileServiceTests.cs

@ -9,21 +9,20 @@ using System; @@ -9,21 +9,20 @@ using System;
using System.IO;
using System.Text;
using ICSharpCode.RubyBinding;
using ICSharpCode.Scripting;
using NUnit.Framework;
namespace RubyBinding.Tests.Utils.Tests
namespace ICSharpCode.Scripting.Tests.Utils.Tests
{
[TestFixture]
public class MockRubyFileServiceTestFixture
public class MockScriptingFileServiceTests
{
MockRubyFileService fileService;
MockScriptingFileService fileService;
[SetUp]
public void Init()
{
fileService = new MockRubyFileService();
fileService = new MockScriptingFileService();
}
[Test]
Loading…
Cancel
Save