예제 #1
0
        public void ThirtyDays()
        {
            StringBuilder fakeoutput = new StringBuilder();

            Console.SetOut(new StringWriter(fakeoutput));
            Console.SetIn(new StringReader("a\n"));

            Program.Main(new string[] { });
            var output = fakeoutput.ToString();

            Approvals.AssertEquals(output, output);
        }
예제 #2
0
        public void ThirtyDays()
        {
            StringBuilder fakeoutput = new StringBuilder();

            Console.SetOut(new StringWriter(fakeoutput));
            Console.SetIn(new StringReader("a\n"));

            Program.Main(new string[] { });
            String output = fakeoutput.ToString();

            using (var reader = new StreamReader(new FileStream("ApprovalTest.ThirtyDays.received.txt", FileMode.Open)))
            {
                Approvals.AssertEquals(reader.ReadToEnd(), output);
            }
        }