From 7767977b32d967d64e5c129c1c6c4b0f98d59aa2 Mon Sep 17 00:00:00 2001 From: mrward Date: Fri, 3 Sep 2010 15:44:05 +0100 Subject: [PATCH] Move file service code in IronPython and IronRuby addins to common Scripting project. --- .../Project/PythonBinding.csproj | 2 - .../Project/Src/IPythonFileService.cs | 23 ------- .../Project/Src/PythonFileService.cs | 38 ----------- .../Project/Src/PythonTestDebugger.cs | 7 +- .../Project/Src/PythonTestRunner.cs | 6 +- .../Src/PythonTestRunnerApplication.cs | 4 +- .../Project/Src/PythonTestRunnerContext.cs | 11 +-- .../Test/PythonBinding.Tests.csproj | 2 - ...buggerRunsSelectedTestMethodTestFixture.cs | 4 +- ...RunnerRunsSelectedTestMethodTestFixture.cs | 4 +- .../Test/Utils/MockPythonFileService.cs | 65 ------------------ .../Tests/MockPythonFileServiceTestFixture.cs | 67 ------------------- .../RubyBinding/Project/RubyBinding.csproj | 2 - .../Project/Src/RubyTestDebugger.cs | 7 +- .../RubyBinding/Project/Src/RubyTestRunner.cs | 6 +- .../Project/Src/RubyTestRunnerApplication.cs | 4 +- .../Project/Src/RubyTestRunnerContext.cs | 9 +-- .../RubyBinding/Test/RubyBinding.Tests.csproj | 3 - ...buggerRunsSelectedTestMethodTestFixture.cs | 4 +- .../Testing/RubyTestRunnerApplicationTests.cs | 2 +- ...RunnerRunsSelectedTestMethodTestFixture.cs | 4 +- .../Project/ICSharpCode.Scripting.csproj | 7 ++ .../Project/Src/IScriptingFileService.cs} | 5 +- .../Project/Src/ScriptingFileService.cs} | 5 +- .../Test/ICSharpCode.Scripting.Tests.csproj | 6 ++ .../Test/Utils/MockScriptingFileService.cs} | 5 +- .../Tests/MockScriptingFileServiceTests.cs} | 9 ++- 27 files changed, 63 insertions(+), 248 deletions(-) delete mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonFileService.cs delete mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFileService.cs delete mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockPythonFileService.cs delete mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/MockPythonFileServiceTestFixture.cs rename src/AddIns/BackendBindings/{Ruby/RubyBinding/Project/Src/IRubyFileService.cs => Scripting/Project/Src/IScriptingFileService.cs} (80%) rename src/AddIns/BackendBindings/{Ruby/RubyBinding/Project/Src/RubyFileService.cs => Scripting/Project/Src/ScriptingFileService.cs} (85%) rename src/AddIns/BackendBindings/{Ruby/RubyBinding/Test/Utils/MockRubyFileService.cs => Scripting/Test/Utils/MockScriptingFileService.cs} (92%) rename src/AddIns/BackendBindings/{Ruby/RubyBinding/Test/Utils/Tests/MockRubyFileServiceTestFixture.cs => Scripting/Test/Utils/Tests/MockScriptingFileServiceTests.cs} (89%) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj index c03333264e..17ec708ebb 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj @@ -90,7 +90,6 @@ - @@ -98,7 +97,6 @@ - diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonFileService.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonFileService.cs deleted file mode 100644 index f801e55a8a..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonFileService.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// -// -// -// $Revision$ -// - -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); - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFileService.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFileService.cs deleted file mode 100644 index ca18f90e70..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonFileService.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// -// -// -// $Revision$ -// - -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); - } - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestDebugger.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestDebugger.cs index 1adaaf4a15..16ee952bb6 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestDebugger.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestDebugger.cs @@ -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 public class PythonTestDebugger : TestDebuggerBase { PythonAddInOptions options; - IPythonFileService fileService; + IScriptingFileService fileService; PythonTestRunnerApplication testRunnerApplication; PythonStandardLibraryPath pythonStandardLibraryPath; @@ -24,7 +25,7 @@ namespace ICSharpCode.PythonBinding new TestResultsMonitor(), new PythonAddInOptions(), new PythonStandardLibraryPath(), - new PythonFileService()) + new ScriptingFileService()) { } @@ -33,7 +34,7 @@ namespace ICSharpCode.PythonBinding ITestResultsMonitor testResultsMonitor, PythonAddInOptions options, PythonStandardLibraryPath pythonStandardLibraryPath, - IPythonFileService fileService) + IScriptingFileService fileService) : base(debuggerService, messageService, testResultsMonitor) { this.options = options; diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunner.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunner.cs index a0338145dd..0f84554c4a 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunner.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunner.cs @@ -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 { PythonAddInOptions options; PythonStandardLibraryPath pythonStandardLibraryPath; - IPythonFileService fileService; + IScriptingFileService fileService; PythonTestRunnerApplication testRunnerApplication; public PythonTestRunner() @@ -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) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerApplication.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerApplication.cs index 5824532a81..99f8673691 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerApplication.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerApplication.cs @@ -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; diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerContext.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerContext.cs index 80ca9a114d..f9031afb6c 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerContext.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTestRunnerContext.cs @@ -6,6 +6,7 @@ // using System; +using ICSharpCode.Scripting; using ICSharpCode.UnitTesting; 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 new UnitTestMessageService(), new PythonAddInOptions(), new PythonStandardLibraryPath(), - new PythonFileService()) + new ScriptingFileService()) { } @@ -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; } } } } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj index 7a8ebf4515..35bfcc9471 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj @@ -438,7 +438,6 @@ - @@ -450,7 +449,6 @@ - diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestDebuggerRunsSelectedTestMethodTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestDebuggerRunsSelectedTestMethodTestFixture.cs index 2362a43060..3a1a0df03c 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestDebuggerRunsSelectedTestMethodTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestDebuggerRunsSelectedTestMethodTestFixture.cs @@ -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 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); } diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestRunnerRunsSelectedTestMethodTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestRunnerRunsSelectedTestMethodTestFixture.cs index a2d337d638..fb331fb3fe 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestRunnerRunsSelectedTestMethodTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestRunnerRunsSelectedTestMethodTestFixture.cs @@ -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 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, diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockPythonFileService.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockPythonFileService.cs deleted file mode 100644 index e1f7363efa..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockPythonFileService.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// -// -// -// $Revision$ -// - -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; - } - } -} diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/MockPythonFileServiceTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/MockPythonFileServiceTestFixture.cs deleted file mode 100644 index 7457fd2e87..0000000000 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/Tests/MockPythonFileServiceTestFixture.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// -// -// -// $Revision$ -// - -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); - } - } -} diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj index 7d94344aa0..fd6b78d9eb 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj @@ -88,7 +88,6 @@ - @@ -110,7 +109,6 @@ - diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestDebugger.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestDebugger.cs index 181a7d87f2..e00f70caef 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestDebugger.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestDebugger.cs @@ -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 public class RubyTestDebugger : TestDebuggerBase { RubyAddInOptions options; - IRubyFileService fileService; + IScriptingFileService fileService; RubyTestRunnerApplication testRunnerApplication; public RubyTestDebugger() @@ -23,7 +24,7 @@ namespace ICSharpCode.RubyBinding new UnitTestMessageService(), new TestResultsMonitor(), new RubyAddInOptions(), - new RubyFileService()) + new ScriptingFileService()) { } @@ -31,7 +32,7 @@ namespace ICSharpCode.RubyBinding IUnitTestMessageService messageService, ITestResultsMonitor testResultsMonitor, RubyAddInOptions options, - IRubyFileService fileService) + IScriptingFileService fileService) : base(debuggerService, messageService, testResultsMonitor) { this.options = options; diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunner.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunner.cs index 14f9fc556d..8ad2b1621d 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunner.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunner.cs @@ -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 public class RubyTestRunner : TestProcessRunnerBase { RubyAddInOptions options; - IRubyFileService fileService; + IScriptingFileService fileService; RubyTestRunnerApplication testRunnerApplication; public RubyTestRunner() @@ -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; } diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerApplication.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerApplication.cs index 8277a8f770..4ecf7fa827 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerApplication.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerApplication.cs @@ -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; diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerContext.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerContext.cs index 7c21b40c95..f67ebe4a87 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerContext.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTestRunnerContext.cs @@ -6,6 +6,7 @@ // using System; +using ICSharpCode.Scripting; using ICSharpCode.UnitTesting; 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 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 get { return options; } } - public IRubyFileService RubyFileService { + public IScriptingFileService ScriptingFileService { get { return fileService; } } } diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj index 3ac501ed33..2f5510137d 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj @@ -332,14 +332,12 @@ - - RubyBinding.addin @@ -349,7 +347,6 @@ - {6C55B776-26D4-4DB3-A6AB-87E783B2F3D1} ICSharpCode.AvalonEdit diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs index c12eb9a5a4..8ea9f03365 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs @@ -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 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); } diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs index 15776ba036..c3143c2a59 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs @@ -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()); diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs index 5ab6cee35b..40cdb87bab 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs @@ -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 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); diff --git a/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj b/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj index 9c2b833fa6..14aafbe94c 100644 --- a/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj +++ b/src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj @@ -70,10 +70,12 @@ + + @@ -93,6 +95,11 @@ ICSharpCode.Core False + + {1F261725-6318-4434-A1B1-6C70CE4CD324} + UnitTesting + False + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/IRubyFileService.cs b/src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingFileService.cs similarity index 80% rename from src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/IRubyFileService.cs rename to src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingFileService.cs index 62cd2a3b0a..6b4d3911f6 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/IRubyFileService.cs +++ b/src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingFileService.cs @@ -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); diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyFileService.cs b/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingFileService.cs similarity index 85% rename from src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyFileService.cs rename to src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingFileService.cs index 8a0a634219..f8d77c2d8f 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyFileService.cs +++ b/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingFileService.cs @@ -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() { diff --git a/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj b/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj index 41c1f30141..828ed7fec7 100644 --- a/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj +++ b/src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj @@ -110,6 +110,7 @@ + @@ -125,6 +126,7 @@ + @@ -151,6 +153,10 @@ {44A8DE09-CAB9-49D8-9CFC-5EB0A552F181} UnitTesting.Tests + + {1F261725-6318-4434-A1B1-6C70CE4CD324} + UnitTesting + {7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57} FormsDesigner diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MockRubyFileService.cs b/src/AddIns/BackendBindings/Scripting/Test/Utils/MockScriptingFileService.cs similarity index 92% rename from src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MockRubyFileService.cs rename to src/AddIns/BackendBindings/Scripting/Test/Utils/MockScriptingFileService.cs index 18a7910954..9c30fb8b32 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MockRubyFileService.cs +++ b/src/AddIns/BackendBindings/Scripting/Test/Utils/MockScriptingFileService.cs @@ -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; diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/Tests/MockRubyFileServiceTestFixture.cs b/src/AddIns/BackendBindings/Scripting/Test/Utils/Tests/MockScriptingFileServiceTests.cs similarity index 89% rename from src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/Tests/MockRubyFileServiceTestFixture.cs rename to src/AddIns/BackendBindings/Scripting/Test/Utils/Tests/MockScriptingFileServiceTests.cs index 9146f69cf7..199b89cff1 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/Tests/MockRubyFileServiceTestFixture.cs +++ b/src/AddIns/BackendBindings/Scripting/Test/Utils/Tests/MockScriptingFileServiceTests.cs @@ -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]