Exemplo n.º 1
0
        public void TestGetWordAtIndexWithValidIndex()
        {
            int       testIndex = 3;
            InputFile file      = InputFile.GetInputFile(TestFileNameContents.Example2FileName);

            Assert.AreEqual("plan", file.GetWordAtIndex(testIndex));
        }
Exemplo n.º 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);
            }
        }