コード例 #1
0
 public void DecreaseIndent_FromZero_Throws()
 {
     using (var writer = new StringWriter())
     {
         var actualWriter = new IndentedTextWriter(writer, "aaa", 0);
         actualWriter.DecreaseIndent();
     }
 }
コード例 #2
0
 public void Constructor_NegativeIndent_Throws()
 {
     using (var writer = new StringWriter())
     {
         var actualWriter = new IndentedTextWriter(writer, "aaa", -1);
         actualWriter.DecreaseIndent();
     }
 }
コード例 #3
0
        public void IncrementIndent_FromNonZero_IndentDecreases()
        {
            using (var writer = new StringWriter())
            {
                var actualWriter = new IndentedTextWriter(writer, "aaa", 0);
                actualWriter.IncreaseIndent();
                actualWriter.IncreaseIndent();
                actualWriter.DecreaseIndent();
                actualWriter.Write("Hello");
                var actualText = writer.ToString();

                Assert.AreEqual("aaaHello", actualText);
            }
        }