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));
     }
 }
Exemplo n.º 2
0
        public void Init()
        {
            string tempFileName = "temp.tmp";
            MockScriptingFileService fileService = new MockScriptingFileService();

            fileService.SetTempFileName(tempFileName);
            fileService.SetTextWriter(new StringWriter());

            Properties properties = new Properties();

            options = new RubyAddInOptions(properties);

            AddInPathHelper helper = new AddInPathHelper("RubyBinding");
            AddIn           addin  = helper.CreateDummyAddInInsideAddInTree();

            addin.FileName = @"c:\rubybinding\rubybinding.addin";

            string testResultsFileName = "results.txt";

            testRunner = new RubyTestRunnerApplication(testResultsFileName, options, fileService);
        }
 void CreateTemporaryResponseFileWriter()
 {
     responseFileText         = new StringBuilder();
     responseFileStringWriter = new StringWriter(responseFileText);
     fileService.SetTextWriter(responseFileStringWriter);
 }