Beispiel #1
0
        public void GivenCSVFile_WhenWrongFileName_ShouldThrowCustomException()
        {
            string filePath  = @"C:\Users\punee\source\repos\StateCensusAnalyser\StateCensusAnalyser\IndiaStateCensusData.csx";
            var    exception = Assert.Throws <CSVException>(() => CSVStateCensusRecords.GetRecords(filePath));

            Assert.AreEqual(CSVException.ExceptionType.FILE_NAME_INCORRECT, exception.type);
        }
Beispiel #2
0
        public void GivenCSVFile_WhenNumberOfRecordsMatches_ShouldReturnTrue()
        {
            string filePath   = @"C:\Users\punee\source\repos\StateCensusAnalyser\StateCensusAnalyser\IndiaStateCensusData.csv";
            int    CSVRecords = CSVStateCensusRecords.GetRecords(filePath);
            int    records    = StateCensusAnalyserUtility.GetStateCensusRecords(filePath);

            Assert.AreEqual(CSVRecords, records);
        }