コード例 #1
0
        public void GivenCSVStateCodeFile_WhenNumberOfRecordsMatches_ShoulReturnTrue()
        {
            string filePath   = @"E:\CodinClub\Assignments_Fellowship\Indian-State-Census-Analyzer-Problem\StateCensusAnalyser\StateCensusAnalyser\IndiaStateCode.csv";
            int    CSVRecords = CSVStates.GetRecords(filePath);
            int    records    = StateCensusAnalyser.StateCodeAnalyser.GetStateCodeRecords(filePath);

            Assert.AreEqual(CSVRecords, records);
        }
コード例 #2
0
 public void GivenCSVStateCodeFilePath_WhenIncorrect_ShouldThrowCustomException()
 {
     try
     {
         string filePath   = @"C:\Assignments_Fellowship\Indian-State-Census-Analyzer-Problem\StateCensusAnalyser\StateCensusAnalyser\IndiaStateCode.csv";
         int    CSVRecords = CSVStates.GetRecords(filePath);
         int    records    = StateCensusAnalyser.StateCodeAnalyser.GetStateCodeRecords(filePath);
         Assert.AreEqual(CSVRecords, records);
     }
     catch (StateCensusAnalyserException e)
     {
         Assert.AreEqual(StateCensusAnalyserException.ExceptionType.INVALID_PATH, e.type);
     }
 }