Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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"));
        }
Beispiel #3
0
        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"));
        }
Beispiel #4
0
        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"));
        }
Beispiel #5
0
 static void Main(string[] args)
 {
     KattisSolver kattisSolver = new KattisSolver(Console.OpenStandardInput(), Console.OpenStandardOutput());
     kattisSolver.SolveOnStreams();
 }
Beispiel #6
0
        static void Main(string[] args)
        {
            KattisSolver kattisSolver = new KattisSolver(Console.OpenStandardInput(), Console.OpenStandardOutput());

            kattisSolver.SolveOnStreams();
        }