public void ShouldNotAllowLengthToBecomeNegative() { const int startLength = 0; const int expectedLength = 0; IPencil pencil = GetPencil(length: startLength); pencil.Sharpen(); Assert.Equal(expectedLength, pencil.CurrentLength); }
public void ShouldReducePencilLengthByOne() { const int startLength = 5; const int expectedLength = 4; IPencil pencil = GetPencil(length: startLength); pencil.Sharpen(); Assert.Equal(expectedLength, pencil.CurrentLength); }
public void ShouldSharpenToThePositiveValueForNegativeDurability() { const int startPointDurability = -10; const int expectedPointDurability = 10; IPencil pencil = GetPencil(pointDurability: startPointDurability); pencil.Sharpen(); Assert.Equal(expectedPointDurability, pencil.CurrentPointDurability); }
public void ShouldResetDurabilityToOriginalValue() { const string testSentence = "Text to waste pencil durability for testing sharpening abilities"; const int pointDurability = 100; IPencil pencil = GetPencil(pointDurability: pointDurability); pencil.Write(GetPaper(), testSentence); pencil.Sharpen(); Assert.Equal(pointDurability, pencil.CurrentPointDurability); }
public void ShouldNotResetDurabilityWhenZeroLength() { const string testSentence = "Keep it simple"; const int length = 0; const int startPointDurability = 100; const int expectedPointDurability = 87; IPencil pencil = GetPencil(pointDurability: startPointDurability, length: length); pencil.Write(GetPaper(), testSentence); pencil.Sharpen(); Assert.Equal(expectedPointDurability, pencil.CurrentPointDurability); }