public void TestGetWordAtIndexWithValidIndex() { int testIndex = 3; InputFile file = InputFile.GetInputFile(TestFileNameContents.Example2FileName); Assert.AreEqual("plan", file.GetWordAtIndex(testIndex)); }
public void TestGetWordAtIndexWithInvalidIndex() { int testIndex = 3; InputFile file = InputFile.GetInputFile(TestFileNameContents.Example2FileName); try { file.GetWordAtIndex(testIndex); } catch (ArgumentException e) { Assert.AreEqual(ErrorMessageConstants.InvalidInputFileIndexErrorMessage, e.Message); } }