public void givenIndianCensusCSVFileReturnsCorrectRecords()
        {
            CensusAnalyzer censusAnalyzer = new CensusAnalyzer();
            int            numOfRecords   = censusAnalyzer.loadCensusData(CSVFilePath);

            Assert.AreEqual(29, numOfRecords);
        }
 public void givenIndiaCensusData_WithWrongFile_ShouldThrowException()
 {
     try
     {
         CensusAnalyzer censusAnalyzer = new CensusAnalyzer();
         censusAnalyzer.loadCensusData(WRONG_CSV_FILE_PATH);
     }
     catch (CensusAnalyserException e) {
         Assert.AreEqual(CensusAnalyserException.ExceptionType.FILE_NOT_FOUND, e.type);
     }
 }
 public void givenIndiaCensusData_WithCorrectFileButHeaderIncorrect_ShouldThrowException()
 {
     try
     {
         CensusAnalyzer censusAnalyzer = new CensusAnalyzer();
         int            totalItems     = censusAnalyzer.loadCensusData(CSVFilePath);
     }
     catch (CensusAnalyserException e)
     {
         Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_HEADER, e.type);
     }
 }
 public void givenindiacensusdata_withincorrectdelimiter_shouldthrowexception()
 {
     try
     {
         CensusAnalyzer censusAnalyzer = new CensusAnalyzer();
         censusAnalyzer.loadCensusData(CSVFilePath);
     }
     catch (CensusAnalyserException e)
     {
         Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_DELIMITER, e.type);
     }
 }
 public void givenIndiaCensusData_WithCorrectFileButTypeIncorrect_ShouldThrowException()
 {
     try
     {
         CensusAnalyzer censusAnalyzer = new CensusAnalyzer();
         censusAnalyzer.loadCensusData(WRONG_CSV_FILE_TYPE);
     }
     catch (CensusAnalyserException e)
     {
         Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_TYPE, e.type);
     }
 }