Esempio n. 1
0
        public void EraserDegrades()
        {
            WriterActions writer = new WriterActions();

            writer.ProcessInput("how much wood would.");
            writer.Erase("much w");

            Assert.AreEqual(1994, writer.pencil.GetCurrentEraserDurability());
        }
Esempio n. 2
0
        public void EraserDurabilityWhenEmptyStringErased()
        {
            WriterActions writer = new WriterActions();

            writer.ProcessInput("how much wood would.");
            writer.Erase("");

            Assert.AreEqual(2000, writer.pencil.GetCurrentEraserDurability());
        }
Esempio n. 3
0
        public void EraseNoText()
        {
            WriterActions writer = new WriterActions();

            writer.ProcessInput("how much wood would.");
            writer.Erase("");

            Assert.AreEqual("how much wood would.", string.Join(null, writer.paper.ToArray()));
        }
Esempio n. 4
0
        public void EraserDegradesWhileErasing()
        {
            WriterActions writer = new WriterActions();

            writer.ProcessInput("Buffalo Bill");
            writer.pencil.DecreaseEraserDurability(1997); // Degrade eraser to three.
            writer.Erase("Bill");

            Assert.AreEqual("Buffalo B   ", string.Join(null, writer.paper.ToArray()));
        }
Esempio n. 5
0
        public void EraseWhenEraserDurabilityZero()
        {
            WriterActions writer = new WriterActions();

            writer.ProcessInput("how much wood would.");
            writer.pencil.DecreaseEraserDurability(2000); // Degrade eraser to zero.
            writer.Erase("how ");

            Assert.AreEqual("how much wood would.", string.Join(null, writer.paper.ToArray()));
        }