예제 #1
0
        public void CorrectlyOutputsColorString_NoSubStrings()
        {
            const string expectedOutput = "Hello World!";
            ColorString  colorString    = new ColorString(expectedOutput, ConsoleColor.Red);

            _output.WriteLine(colorString);

            StringBuilder outputStringBuilder = _textWriter.GetStringBuilder();
            string        output = outputStringBuilder.ToString();

            Assert.AreEqual(expectedOutput + "\r\n", output);
        }
예제 #2
0
        private void displayDifferences(CultureCurrencyInfo fromGlobalization, CurrencyInfo fromConfiguration, IEnumerable <KeyValuePair <string, Pair> > differences, TextMessageWriter writer)
        {
            displayCultureInformation(writer, fromGlobalization, fromConfiguration);

            foreach (var diff in differences)
            {
                displayDifference(writer, diff);
            }

            writer.Flush();
            WL(writer.ToString());
            StringBuilder sb = writer.GetStringBuilder();

            sb.Remove(0, sb.Length);
            RL();
        }