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!"); }
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); }
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!"); }