Esempio n. 1
0
        public void TestProcessFileThrowsException()
        {
            InputFileValidator validator = new InputFileValidator();

            Assert.ThrowsException <IndexOutOfRangeException>(
                () => validator.ProcessFile(Constants.INPUT_FILE_DIRECTORY + "Test1-MissingRequiredFields.txt"));
            Assert.ThrowsException <FormatException>(
                () => validator.ProcessFile(Constants.INPUT_FILE_DIRECTORY + "Test2-MalformedDOB.txt"));
            Assert.ThrowsException <ArgumentOutOfRangeException>(
                () => validator.ProcessFile(Constants.INPUT_FILE_DIRECTORY + "Test2b-InvalidDOB.txt"));
            Assert.ThrowsException <ArgumentException>(
                () => validator.ProcessFile(Constants.INPUT_FILE_DIRECTORY + "Test3-InvalidPlanType.txt"));
            Assert.ThrowsException <FormatException>(
                () => validator.ProcessFile(Constants.INPUT_FILE_DIRECTORY + "Test4-MalformedEffectiveDate.txt"));
            Assert.ThrowsException <ArgumentOutOfRangeException>(
                () => validator.ProcessFile(Constants.INPUT_FILE_DIRECTORY + "Test4b-InvalidEffectiveDate.txt"));
        }