public void PencilAppendsTextToExistingContentOnPaper()
        {
            //Arrange
            var letterToGrandma = "Thanks so much for the five dollars you sent for my birthday. ";
            var letterContinued = "Dad reassures me you understand what inflation is. I'm not convinced.";
            var collegeRule     = new PaperModel();

            NumberTwoPencil = new Pencil();

            //Act
            NumberTwoPencil.WriteInputOntoPaper(letterToGrandma, collegeRule);
            NumberTwoPencil.WriteInputOntoPaper(letterContinued, collegeRule);

            //Assert
            StringAssert.AreEqualIgnoringCase(letterToGrandma += letterContinued, collegeRule.WrittenContent);
        }
Exemple #2
0
        public void UsingSharpenMethodDecrementsPencilLengthByOne()
        {
            //Assert

            var lengthAfterSharpening = 3;
            var aWord = "A word";

            Paper = new PaperModel();

            //Act
            HydratedPencil.WriteInputOntoPaper(aWord, Paper);
            HydratedPencil.Sharpen();

            //Assert
            Assert.AreEqual(lengthAfterSharpening, HydratedPencil.PencilLength);
        }
 public static void WriteMore(Pencil pencil, PaperModel paper)
 {
     Console.WriteLine(paper.WrittenContent);
     Console.WriteLine();
     Console.WriteLine("Add whatever you'd like to what you've written!");
     pencil.WriteInputOntoPaper(Console.ReadLine(), paper);
     Console.WriteLine(paper.WrittenContent);
     Console.WriteLine();
     SelectOptions(pencil, paper);
 }
        public void CamelCaseInputStillReplacedByWhiteSpaceOncePencilDull()
        {
            //Arrange
            NumberTwoPencil = new Pencil(3);
            Paper           = new PaperModel();
            var myInitials = "Jjb";

            //Act
            NumberTwoPencil.WriteInputOntoPaper(myInitials, Paper);

            //Assert
            Assert.AreEqual("Jj ", Paper.WrittenContent);
        }
        public void OncePencilIsDullRemainingCharactersWrittenAsWhiteSpaces()
        {
            //Arrange
            NumberTwoPencil = new Pencil(1);
            Paper           = new PaperModel();
            var twoLetters = "jb";

            //Act
            NumberTwoPencil.WriteInputOntoPaper(twoLetters, Paper);

            //Assert
            Assert.AreEqual("j ", Paper.WrittenContent);
        }
        public static void Main(string[] args)
        {
            PaperModel paper  = new PaperModel();
            Pencil     pencil = CreatePencil();

            Console.WriteLine("Ok, let's try writing something. Type whatever you'd like below!");
            pencil.WriteInputOntoPaper(Console.ReadLine(), paper);
            Console.WriteLine();
            Console.WriteLine("You wrote -- " + paper.WrittenContent);
            SelectOptions(pencil, paper);


            Console.ReadLine();
        }
        public void WhiteSpacesInGivenInputDoNotReduceDurability()
        {
            //Arrange
            var receipt               = new PaperModel();
            var highlighter           = new Pencil(20);
            var taxDeductiblePurchase = "office supplies";
            var inkLeft               = 6;

            //Act
            highlighter.WriteInputOntoPaper(taxDeductiblePurchase, receipt);

            //Assert
            Assert.AreEqual(inkLeft, highlighter.PencilDurability);
        }
        public void PencilDurabilityFunctionReducesDurabilityByOnePerLetter()
        {
            //Arrange
            var backOfEnvelope = new PaperModel();
            var groceryList    = "eggs and milk";
            var inkLeft        = 9;
            var bicPen         = new Pencil(20);

            //Act
            bicPen.WriteInputOntoPaper(groceryList, backOfEnvelope);

            //Assert
            Assert.AreEqual(inkLeft, bicPen.PencilDurability);
        }
        public void PaperContainsTextPencilWrites()
        {
            //Arrange
            var letterToSanta     = "Dear Santa, I hope you're well";
            var constructionPaper = new PaperModel();

            NumberTwoPencil = new Pencil();

            //Act
            NumberTwoPencil.WriteInputOntoPaper(letterToSanta, constructionPaper);

            //Assert
            StringAssert.AreEqualIgnoringCase(letterToSanta, constructionPaper.WrittenContent);
        }
        public void IfDurabilityLowerThanTwoPencilDoesNotWriteCapitalLetter()
        {
            //Arrange
            NumberTwoPencil = new Pencil(1);
            Paper           = new PaperModel();
            var capitalLetter = "J";

            //Act
            NumberTwoPencil.WriteInputOntoPaper(capitalLetter, Paper);

            //Assert
            Assert.AreNotEqual(capitalLetter, Paper.WrittenContent);
            Assert.AreEqual(Paper.WrittenContent, "j");
        }
        public void PencilStopsWritingIfDurabilityEqualOrLessThanZero()
        {
            //Arrange
            NumberTwoPencil = new Pencil(5);
            Paper           = new PaperModel();
            var mumble       = "what if";
            var whatWasHeard = "what i ";

            //Act
            NumberTwoPencil.WriteInputOntoPaper(mumble, Paper);

            //Assert
            StringAssert.AreEqualIgnoringCase(whatWasHeard, Paper.WrittenContent);
        }
        public void CapitalLettersReduceDurabilityByTwo()
        {
            //Arrange
            NumberTwoPencil = new Pencil(20);
            var barbaricYawp = "MY YAWPS TOP";

            Paper = new PaperModel();
            var bigWhoppingZero = 0;

            //Act
            NumberTwoPencil.WriteInputOntoPaper(barbaricYawp, Paper);

            //Assert
            Assert.AreEqual(bigWhoppingZero, NumberTwoPencil.PencilDurability);
        }
Exemple #13
0
        public void SharpenerMethodSetsDurabilityEqualToOriginalSharpeness()
        {
            //Arrange
            var inputDurability     = 100;
            var sentenceToBeWritten = "Tip toe through the tulips";

            Pencil = new Pencil(inputDurability);
            Paper  = new PaperModel();

            //Act
            Pencil.WriteInputOntoPaper(sentenceToBeWritten, Paper);
            Pencil.Sharpen();

            //Assert
            Assert.AreEqual(inputDurability, Pencil.PencilDurability);
        }