示例#1
0
        public void TestGetWordAtIndexWithValidIndex()
        {
            int       testIndex = 3;
            InputFile file      = InputFile.GetInputFile(TestFileNameContents.Example2FileName);

            Assert.AreEqual("plan", file.GetWordAtIndex(testIndex));
        }
示例#2
0
        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);
            }
        }