public void GivenCensusCSVFile_WhenNumberOfRecordMatch_ThenItShouldReturnTrue() { int CSVStateRecord = CSVStateCensus.GetCensusRecord(FILE_PATH); int StateCensusRecord = StateCensusAnalyser.GetStateCensusRecord(FILE_PATH); Assert.AreEqual(CSVStateRecord, StateCensusRecord); }
public void GivenCsvData_WhenLoaded_ShouldReturnTrue() { int noOfRecdordsForIndiaCensus = CSVStateCensus.GetLenghtOFCsvFile(INDIAN_CENSUS_FILEPATH); int noOfRecordsForIndiaState = CSVStateCensus.GetLenghtOFCsvFile(INDIAN_CENSUS_FILEPATH); Assert.AreEqual(noOfRecdordsForIndiaCensus, noOfRecordsForIndiaState); }
public void GivenInvalidFileHeader_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStateCensus.GetFileHeader(FILE_PATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.HEADER_NOT_MATCH, exception.type); }
public void GivenIncorrectDelimiter_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStateCensus.GetCensusRecord(FILE_PATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.DELIMITER_INCORRECT, exception.type); }
public void GivenIncorrectFileType_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStateCensus.GetCensusRecord(WRONG_FILETYPE)); Assert.AreEqual(CensusAnalyserException.ExceptionType.INCORRECT_FILETYPE, exception.type); }
public void GivenIncorrectPath_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStateCensus.WrongPath(FILE_PATH, WRONG_FILEPATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_FILEPATH, exception.type); }
public void GivenIvalidFileHeaderToCsvStateClass_WhenLoaded_ShouldReturnExceptionMessage() { var exception = Assert.Throws <CensusAnalyserException>(() => CSVStateCensus.GetFileHeader(INDIAN_STATE_CODE)); Assert.AreEqual(CensusAnalyserException.ExceptionType.HEADER_NOT_MATCH, exception.type); }
public void GivenIvalidDelimiterToCSVstateClass_WhenLoaded_ShouldReturnExceptionMessage() { CensusAnalyserException exception = Assert.Throws <CensusAnalyser.CensusAnalyserException>(() => CSVStateCensus.GetRecordForCsvFile(INDIAN_STATE_CODE)); Assert.AreEqual(CensusAnalyserException.ExceptionType.DELIMITER_INCORRECT, exception.type); }
public void GivenIvalidFileNameToCSVstateClass_WhenLoaded_ShouldReturnExceptionMessage() { CensusAnalyserException exception = Assert.Throws <CensusAnalyserException>(() => CSVStateCensus.GetRecordForCsvFile(WRONG_PATH_CSVFILE_NAME)); Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_FILENAME, exception.type); }
public void GivenIvalidPath_WhenLoaded_ShouldReturnExceptionMessage() { CensusAnalyserException exception = Assert.Throws <CensusAnalyser.CensusAnalyserException>(() => CSVStateCensus.WrongPath(INDIAN_CENSUS_FILEPATH, WRONG_FILEPATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_FILEPATH, exception.type); }