public void GivenStateCodeIncorrectType_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + invalidExtensionFileState, "SrNo,State Name,TIN,StateCode")); Assert.AreEqual(CensusAnalyserException.ExceptionType.IMPROPER_EXTENSION, Exception.type); }
public void GivenStateCodeIncorrectDelimiter_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + invalidDelimiterFileStateCode, "SrNo,State Name,TIN,StateCode")); Assert.AreEqual(CensusAnalyserException.ExceptionType.DELIMITER_NOT_FOUND, Exception.type); }
public void GivenIncorrectHeader_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + invalidHeaderState, "State,Population,AreaInSqKm,DensityPerSqKm")); Assert.AreEqual(CensusAnalyserException.ExceptionType.INCORRECT_HEADER, Exception.type); }
public void GivenStateCodeIncorrectFileName_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + validExtensionFileStateCode + "hi", "SrNo, State Name, TIN, StateCode")); Assert.AreEqual(CensusAnalyserException.ExceptionType.FILE_NOT_EXISTS, Exception.type); }
public void GivenIncorrectType_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + invalidExtensionFileState, "State,Population,AreaInSqKm,DensityPerSqKm")); Assert.AreEqual(CensusAnalyserException.ExceptionType.IMPROPER_EXTENSION, Exception.type); }
public void GivenIncorrectDelimiter_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + invalidDelimiterFileState, "State,Population,AreaInSqKm,DensityPerSqKm")); Assert.AreEqual(CensusAnalyserException.ExceptionType.DELIMITER_NOT_FOUND, Exception.type); }
public void GivenStateCodeIncorrectHeader_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + invalidHeaderStateCode, "SrNo,State Name,TIN,StateCode")); Assert.AreEqual(CensusAnalyserException.ExceptionType.INCORRECT_HEADER, Exception.type); }
public void GivenIncorrectFileName_ReturnsCustomException() { CensusAnalyserException Exception = Assert.Throws <CensusAnalyserException>(() => censusAnalyser.LoadCensusData(folderPath + validStateCensusFileState + "hi", "State,Population,AreaInSqKm,DensityPerSqKm")); Assert.AreEqual(CensusAnalyserException.ExceptionType.FILE_NOT_EXISTS, Exception.type); }
public void GivenIncorrectDelimiterAndCSVState_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStates.GetRecord(STATE_CODE_FILE_PATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.DELIMITER_INCORRECT, exception.type); }
public void GivenInvalidFileHeaderAndCSVState_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStates.GetFileHeader(STATE_CODE_FILE_PATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.HEADER_NOT_MATCH, exception.type); }
public void GivenIncorrectFileTypeAndCSVState_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStates.GetRecord(WRONG_FILETYPE)); Assert.AreEqual(CensusAnalyserException.ExceptionType.INCORRECT_FILETYPE, exception.type); }
public void GivenIncorrectPathAndCSVState_WhenCompiled_ThenReturnsException() { CensusAnalyserException exception = Assert.ThrowsException <CensusAnalyserException>(() => CSVStates.WrongPath(FILE_PATH, WRONG_FILEPATH)); Assert.AreEqual(CensusAnalyserException.ExceptionType.INVALID_FILEPATH, 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); }