public void KattisSolver_Should_WorkOnMultipleLinesOfInput() { // Arrange string result; using (var helper = new StreamHelper("5 3 8", "10 5 2", "5 15 3")) { // Act var kattisSolver = new KattisSolver(helper.InStream, helper.OutStream); kattisSolver.SolveOnStreams(); result = helper.ReadOut(); } // Assert Assert.That(result, Is.EqualTo("5+3=8\r\n10/5=2\r\n5=15/3\r\n")); }
public void KattisSolver_Should_WorkOnStreams() { // Arrange const string data = "5 3 8"; string result; using (var helper = new StreamHelper(data)) { // Act var kattisSolver = new KattisSolver(helper.InStream, helper.OutStream); kattisSolver.SolveOnStreams(); result = helper.ReadOut(); } // Assert Assert.That(result, Is.EqualTo("5+3=8\r\n")); }
static void Main(string[] args) { KattisSolver kattisSolver = new KattisSolver(Console.OpenStandardInput(), Console.OpenStandardOutput()); kattisSolver.SolveOnStreams(); }