public void WriteWordReducesTipDurability() { Pencil pencil = new Pencil(tipDurability20, length500); expectedInt = tipDurabilityAfterPhrase6; pencil.Write(phrase14toWrite12toErasewithWhitespace); actualInt = pencil.GetTip(); Assert.AreEqual(expectedInt, actualInt); }
public void TipCanBeRetrievedWithCheckTip() { Pencil pencil = new Pencil(tipDurability20); expectedInt = tipDurability20; actualInt = pencil.GetTip(); Assert.AreEqual(expectedInt, actualInt); }
private void SharpenOneValue(int pencilTip) { Pencil pencil = new Pencil(pencilTip); pencil.Write(phrase14toWrite12toErasewithWhitespace); pencil.Sharpen(); actualInt = pencil.GetTip(); Assert.AreEqual(pencilTip, actualInt); }
public void SharpenReturnsToMaxValue() { Pencil pencil = new Pencil(tipDurability20, length500); expectedInt = tipDurability20; pencil.Sharpen(); actualInt = pencil.GetTip(); Assert.AreEqual(expectedInt, actualInt); }
public void WriteStopsAt0Durabilility() { Pencil pencil = new Pencil(tipDurability20, length500, eraserDurability10); expectedInt = 0; pencil.Write(phrase14toWrite12toErasewithWhitespace); pencil.Write(phrase14toWrite12toErasewithWhitespace); actualInt = pencil.GetTip(); Assert.AreEqual(expectedInt, actualInt); }
public void WriteAdjustsDurabilityCorrectilyForWhiteSpaceWithMoreLettersThanDurabilityLeft() { Pencil pencil = new Pencil(tipDurability20); string longPhrase = "This Phrase Is More Than Twenty Durability"; //43 total durability expectedString = "This Phrase Is More "; //20 written durability, 26 white spaces (3 no durability white spaces) int expectedTip = 0; actualString = pencil.Write(longPhrase); int actualTip = pencil.GetTip(); Assert.AreEqual(expectedString, actualString); Assert.AreEqual(expectedTip, actualTip); }
public void SharpenPencilWithZeroLengthDoesNotReturnTipToMaximum() { int zeroPencilLength = 0; Pencil pencil = new Pencil(tipDurability20, zeroPencilLength, eraserDurability10); pencil.Write(singleWord5toWrite4toErase); expectedInt = tipDurabilityAfterSingle15; pencil.Sharpen(); actualInt = pencil.GetTip(); Assert.AreEqual(expectedInt, actualInt); }
public void WriteCapitalLetterWithOnePointDurabilityReturnsCapitalLetterAnd0Durability() { Pencil pencil = new Pencil(1); expectedString = "T"; expectedInt = 0; actualString = pencil.Write("T"); actualInt = pencil.GetTip(); Assert.AreEqual(expectedInt, actualInt); Assert.AreEqual(expectedString, actualString); }