public void ImportWrongClassThrowsException() { //Arrange var import = new ImportCSV("SchoolTest.csv"); //Act and Assert var ex = Assert.ThrowsException <ArgumentException>(() => import.getDataFromCSV <BlankClass>()); Assert.AreEqual("Model name does not exist", ex.Message); }
public void ImportSchoolResultData() { //Arrange var import = new ImportCSV("SchoolResultTest.csv"); //Act var data = import.getDataFromCSV <SchoolResult>(); //Assert Assert.AreEqual(_data["SchoolResultTest"].Count(), data.Count()); }
public void ImportSchoolDataExcludesFieldsNotInMap() { //Arrange var import = new ImportCSV("SchoolTestExtraFields.csv"); //Act var data = import.getDataFromCSV <School>(); //Assert Assert.AreEqual(_data["SchoolTestExtraFields"].Count(), data.Count()); }
public void ImportSchoolDataWithNullRecords() { //Arrange var import = new ImportCSV("SchoolTestNullRecords.csv"); //Act var data = import.getDataFromCSV <School>(); //Assert Assert.AreEqual(_data["SchoolTestNullRecords"].Count(), data.Count()); }
public void ImportSchoolContextualDataIncludesNATData() { //Arrange var import = new ImportCSV("SchoolContextualTestNAT.csv"); //Act var data = import.getDataFromCSV <SchoolContextual>(); //Assert Assert.AreEqual(_data["SchoolContextualTestNAT"].Count(), data.Count()); }
public void FileDoesNotExistException() { //Arrange var import = new ImportCSV("FileDoesNotExist.csv"); //Act and Assert var ex = Assert.ThrowsException <FileNotFoundException>(() => import.getDataFromCSV <School>()); Assert.AreEqual("CSV file does not exist", ex.Message); }
public void ImportSchoolResultIgnoreRecordsWithAllNullResults() { //Arrange var import = new ImportCSV("SchoolResultTestAllNullRecords.csv"); //Act var data = import.getDataFromCSV <SchoolResult>(); //Assert Assert.AreEqual(_data["SchoolResultTestAllNullRecords"].Count() - 1, data.Count()); }
public void ImportSchoolDataIgnoreRowsWithTwoOrLessFields() { //Arrange var import = new ImportCSV("SchoolTestDifferentRowLength.csv"); //Act var data = import.getDataFromCSV <School>(); //Assert //Checks the data omits the 1 row that has only 2 fields Assert.AreEqual(_data["SchoolTestDifferentRowLength"].Count() - 1, data.Count()); }