示例#1
0
        public void it_erases_last_instance_of_string_on_paper()
        {
            var prevText      = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?";
            var firstNewText  = "How much wood would a woodchuck chuck if a woodchuck could       wood?";
            var secondNewText = "How much wood would a woodchuck chuck if a wood      could       wood?";

            var paper  = new Paper(prevText);
            var pencil = new Pencil();

            pencil.erase(paper, "chuck");
            Assert.AreEqual(firstNewText, paper.read());

            pencil.erase(paper, "chuck");
            Assert.AreEqual(secondNewText, paper.read());
        }
示例#2
0
        public void pencil_created_with_no_parameters_has_default_durability()
        {
            var pencil = new Pencil();

            Assert.AreEqual(Pencil.DEFAULT_DURABILITY, pencil.durability);
        }