public void GivenCSVFile_WhenNumberOfRecordsMatches_ShoulReturnTrue() { string filePath = @"E:\CodinClub\Assignments_Fellowship\Census_Analyser_Problem\CensusAnalyser\CensusAnalyser\IndiaStateCensusData.csv"; int CSVRecords = CSVStateCensusAnalyser.GetRecords(filePath); int records = StateCensusAnalyser.GetStateCensusRecords(filePath); Assert.AreEqual(CSVRecords, records); }
public void GivenCSVFileName_WhenIncorrectTypeOfFile_ShouldThrowCustomException() { try { string filePath = @"E:\CodinClub\Census_Analyser_Problem\CensusAnalyser\CensusAnalyser\IndiaStateCensusData.txt"; int CSVRecords = CSVStateCensusAnalyser.GetRecords(filePath); int records = StateCensusAnalyser.GetStateCensusRecords(filePath); Assert.AreEqual(CSVRecords, records); } catch (StateCensusAnalyserException e) { Assert.AreEqual("Name of the file is incorrect", e.Message); } }
public void GivenCSVFilePath_WhenIncorrect_ShouldThrowCustomException() { try { string filePath = @"E:\CodinClub\Census_Analyser_Problem\CensusAnalyser\CensusAnalyser\IndiaStateCensusData.csv"; int CSVRecords = CSVStateCensusAnalyser.GetRecords(filePath); int records = StateCensusAnalyser.GetStateCensusRecords(filePath); Assert.AreEqual(CSVRecords, records); } catch (StateCensusAnalyserException e) { Assert.AreEqual(StateCensusAnalyserException.ExceptionType.INVALID_PATH, e.Type); //Assert.AreEqual(e.Message,"Entered wrong path"); } }