예제 #1
0
        public void Load_Given_NoInvalidFilePath_ShouldThrowFileNotFoundException()
        {
            //---Setup-------------------------------
            IFileLoader fileLoader = new CsvFileLoader();
            string      filePath   = @"C:\SomeLocationSomeWhereInNeverLand\SomeFile.ext";

            //---Execute-----------------------------
            fileLoader.Load(filePath);
            //---Assert------------------------------
            Assert.Fail("Expected Exception not thrown!");
        }
예제 #2
0
        public void Load_Given_ValidFilePath_ShouldReturnRecords()
        {
            //---Setup-------------------------------
            IFileLoader fileLoader = new CsvFileLoader();
            string      filePath   = @"data.csv";
            //---Execute-----------------------------
            var records = fileLoader.Load(filePath);

            //---Assert------------------------------
            Assert.IsTrue(records.Count > 0);
        }
예제 #3
0
        public void Load_Given_NoFilePath_ShouldThrowArgumentNullException()
        {
            //---Setup-------------------------------
            IFileLoader fileLoader = new CsvFileLoader();
            string      filePath   = null;

            //---Execute-----------------------------
            fileLoader.Load(filePath);
            //---Assert------------------------------
            Assert.Fail("Expected Exception not thrown!");
        }