public void AddingToPaper() { WriterActions writer = new WriterActions(); string currentInput = "How"; string expectedOutput = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"; writer.ProcessInput(currentInput); currentInput = " much wood would a woodchuck chuck if a woodchuck could chuck wood?"; writer.ProcessInput(currentInput); Assert.AreEqual(expectedOutput, string.Join(null, writer.paper.ToArray())); }
public void PencilDegradationByZero() { WriterActions writer = new WriterActions(); string currentInput = "shesellsseashells\r\n"; writer.ProcessInput(currentInput); Assert.AreEqual(983, writer.pencil.GetCurrentDurability()); }
public void PencilDegradationByOne() { WriterActions writer = new WriterActions(); string currentInput = "she sells sea shells down by the sea shore"; writer.ProcessInput(currentInput); Assert.AreEqual(966, writer.pencil.GetCurrentDurability()); }
public void CharacterCollision() { WriterActions writer = new WriterActions(); writer.ProcessInput("An a day keeps the doctor away"); writer.Edit("artichoke"); Assert.AreEqual("An artich@k@ay keeps the doctor away", string.Join(null, writer.paper.ToArray())); }
public void EraserDurabilityWhenEmptyStringErased() { WriterActions writer = new WriterActions(); writer.ProcessInput("how much wood would."); writer.Erase(""); Assert.AreEqual(2000, writer.pencil.GetCurrentEraserDurability()); }
public void EditWord() { WriterActions writer = new WriterActions(); writer.ProcessInput("An a day keeps the doctor away"); writer.Edit("onion"); Assert.AreEqual("An onion a day keeps the doctor away", string.Join(null, writer.paper.ToArray())); }
public void EraserDegrades() { WriterActions writer = new WriterActions(); writer.ProcessInput("how much wood would."); writer.Erase("much w"); Assert.AreEqual(1994, writer.pencil.GetCurrentEraserDurability()); }
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())); }
public void InitialWordWritten() { WriterActions writer = new WriterActions(); string currentInput = "How"; writer.ProcessInput(currentInput); Assert.AreEqual(currentInput, string.Join(null, writer.paper.ToArray())); }
public void PencilLengthUpdated() { WriterActions writer = new WriterActions(); writer.ProcessInput("Hello world"); writer.SharpenPencil(); Assert.AreEqual(19, writer.pencil.GetLength()); }
public void WriterSharpensPencil() { WriterActions writer = new WriterActions(); writer.ProcessInput("Hello world"); writer.SharpenPencil(); Assert.AreEqual(1000, writer.pencil.GetCurrentDurability()); }
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())); }
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())); }
public void SpacesWhenLengthIsZero() { WriterActions writer = new WriterActions(); writer.pencil.SetLength(1); writer.pencil.SetDurability(0); writer.SharpenPencil(); writer.ProcessInput("Hello world"); Assert.AreEqual(" ", string.Join(null, writer.paper.ToArray())); }
public void PrintsWhiteSpaceWhenDull() { WriterActions writer = new WriterActions(); string currentInput = "How much wood would"; string expectedOutput = "How much wood w "; writer.pencil.SetDurability(13); writer.ProcessInput(currentInput); Assert.AreEqual(expectedOutput, String.Join(null, writer.paper.ToArray())); }