Пример #1
0
        public void GetHeaders_EmptyFile_ReturnEmptyFileHeaders(ExcelSettings settings, int headersNum)
        {
            // arrange
            ExcelDataImport importer = new ExcelDataImport(settings);

            // act
            var headers = importer.GetHeaders();

            // assert
            Assert.AreEqual(headersNum, headers.Count());
        }
Пример #2
0
        public void GetHeaders_FileDoesNotExist_ThrowFileNotFoundException(ExcelSettings settings)
        {
            // arrange
            ExcelDataImport importer = new ExcelDataImport(settings);

            // act
            TestDelegate action = () => importer.GetHeaders();

            // assert
            Assert.Throws <FileNotFoundException>(action);
        }
Пример #3
0
        public void GetHeaders_NoHeaders_ReturnGenericHeaders(ExcelSettings settings, IEnumerable <object> validHeaders)
        {
            // arrange
            ExcelDataImport importer = new ExcelDataImport(settings);

            // act
            var headers = importer.GetHeaders();

            // assert
            CollectionAssert.AreEqual(validHeaders, headers);
        }