コード例 #1
0
 public StrormConfigurationBuilder()
 {
     ICommunication communication = new StdInOutCommunication();
     IOsSpecific osStuff = new WindowsPidStuff();
     _outputToParent = new WriteStringWithEndTerminator(communication);
     _readerFormat = new JsonProtocolReaderFormat(new WritePidFileAndSendIdToParent(_writerFormat, osStuff, _outputToParent));
     _readNext = new ReadUntillEndRecieved(communication);
 }
コード例 #2
0
        public void ShouldReadFromInStream()
        {
            Console.SetIn(new StringReader("hello"));

            var subjectUnderTest = new StdInOutCommunication();
            var readLine = subjectUnderTest.ReadLine();

            Assert.That(readLine, Is.EqualTo("hello"));
        }
コード例 #3
0
        public StrormConfigurationBuilder()
        {
            ICommunication communication = new StdInOutCommunication();
            IOsSpecific    osStuff       = new WindowsPidStuff();

            _outputToParent = new WriteStringWithEndTerminator(communication);
            _readerFormat   = new JsonProtocolReaderFormat(new WritePidFileAndSendIdToParent(_writerFormat, osStuff, _outputToParent));
            _readNext       = new ReadUntillEndRecieved(communication);
        }
コード例 #4
0
        public void ShouldOutputToError()
        {
            var emptyString = new StringBuilder();
            Console.SetError(new StringWriter(emptyString));

            var subjectUnderTest = new StdInOutCommunication();
            subjectUnderTest.Error("error");

            Assert.That(emptyString.ToString(), Is.EqualTo("error\r\n"));
        }
コード例 #5
0
        public void ShouldOutputOutStrem()
        {
            var emptyString = new StringBuilder();
            Console.SetOut(new StringWriter(emptyString));

            var subjectUnderTest = new StdInOutCommunication();
            subjectUnderTest.WriteLine("hello");
            subjectUnderTest.Flush();

            Assert.That(emptyString.ToString(), Is.EqualTo("hello\r\n"));
        }