コード例 #1
0
        public void TestAppendEmptyLine()
        {
            // Arrange
            var actual = new StringBuilder();

            var expected = new StringBuilder();
            expected.AppendLine();

            // Act
            actual.AppendEmptyLine();

            // Assert
            Assert.AreEqual(expected.ToString(), actual.ToString());
        }
コード例 #2
0
        public void TestAppendEmptyLineWithDebug()
        {
            using (ShimsContext.Create())
            {

                // Arrange
                var actual = new StringBuilder();
                ShimConsole.WriteString = s => { };
                ShimConsole.WriteLineString = s => { };

                var expected = new StringBuilder();
                expected.AppendLine();

                // Act
                actual.AppendEmptyLine(true);

                // Assert
                Assert.AreEqual(expected.ToString(), actual.ToString());
            }
        }