Skip to content
This repository
tree: b770ab3856
Fetching contributors…

Cannot retrieve contributors at this time

file 37 lines (31 sloc) 0.865 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Machine.Specifications.ConsoleRunner.Specs
{
  public class FakeConsole : IConsole
  {
    readonly StringBuilder _console = new StringBuilder();

    public List<string> Lines
    {
      get { return _console.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None).ToList(); }
    }

    public void Write(string line)
    {
      _console.Append(line);
    }

    public void Write(string line, params object[] parameters)
    {
      _console.AppendFormat(line, parameters);
    }

    public void WriteLine(string line)
    {
      _console.AppendLine(line);
    }

    public void WriteLine(string line, params object[] parameters)
    {
      _console.AppendLine(string.Format(line, parameters));
    }
  }
}
Something went wrong with that request. Please try again.