DecreaseIndentation() public method

public DecreaseIndentation ( ) : void
return void
Esempio n. 1
0
        public void DecreasingIndentation_ByMustBeGreaterThanZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            Assert.Throws <ArgumentOutOfRangeException>(() => iw.DecreaseIndentation(0));
            Assert.Throws <ArgumentOutOfRangeException>(() => iw.DecreaseIndentation(-42));
        }
Esempio n. 2
0
        public void DecreasingIndentation_NeverDropsBelowZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.DecreaseIndentation();
            iw.DecreaseIndentation();
            Assert.AreEqual(0, iw.Indentation);
        }
        public void DecreasingIndentation_ByMustBeGreaterThanZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            Assert.Throws<ArgumentOutOfRangeException>(() => iw.DecreaseIndentation(0));
            Assert.Throws<ArgumentOutOfRangeException>(() => iw.DecreaseIndentation(-42));
        }
        public void DecreasingIndentation_NeverDropsBelowZero()
        {
            var sw = new StringWriter();
            var iw = new IndentingTextWriter(sw, "  ");

            iw.DecreaseIndentation();
            iw.DecreaseIndentation();
            Assert.AreEqual(0, iw.Indentation);
        }