Пример #1
0
        public void TestForNumberOfRecord()
        {
            //call the readmethod and it return the number of record
            int record = read.ReadMethod(',');

            Assert.AreEqual(29, record);
        }
Пример #2
0
        public void TestForNumberOfRecordincsvStateCode()
        {
            //call the readmethod and it return the number of record
            int record = ReadForCsvStateCode.ReadMethod(',');

            Assert.AreEqual(37, record);
        }
Пример #3
0
 public void TestForFileNotFoundException()
 {
     try
     {
         //give the  path of not available csv file
         string path = @"D:\trimbak\state analys\StatesusData.csv";
         //call the readmethod and it return the number of record
         BaseStateCensus ReadForStateCensus = new BaseStateCensus(path);
         int             record             = ReadForStateCensus.ReadMethod(',');
     }
     catch (StateCensusException e)
     {
         Assert.AreEqual("file is not present on this location", e.Message);
     }
 }
Пример #4
0
 public void TestForWrongTypeException()
 {
     try
     {
         //chenge file type csv to txt and check
         string path = @"D:\trimbak\state analys\StateCensusData.txt";
         //send the file path
         BaseStateCensus ReadForStateCensus = new BaseStateCensus(path);
         //call the readmethod and it return the number of record
         int record = ReadForStateCensus.ReadMethod(',');
     }
     catch (StateCensusException e)
     {
         Assert.AreEqual("enter proper file", e.Message);
     }
 }
Пример #5
0
 public void TestForWrongTypeExceptionForStateCode()
 {
     try
     {
         //chenge file type csv to txt and check
         string Path = @"D:\trimbak\state analys\StateCode.txt";
         //create object fo csv reder by using local file path
         BaseStateCensus ReadForCsvState = new BaseStateCensus(Path);
         //call the readmethod and it return the number of record
         int record = ReadForCsvState.ReadMethod(',');
     }
     catch (StateCensusException e)
     {
         Assert.AreEqual("enter proper file", e.Message);
     }
 }
Пример #6
0
 public void TestForFileNotFoundExceptionForStateCode()
 {
     try
     {
         //give the  path of not existing csv file
         string Path = @"D:\trimbak\state analys\Statee.csv";
         //create object fo csv reder by using local file path
         BaseStateCensus ReadForCsvState = new BaseStateCensus(Path);
         //call the readmethod and it return the number of record
         int record = ReadForCsvState.ReadMethod(',');
     }
     catch (StateCensusException e)
     {
         Assert.AreEqual("file is not present on this location", e.Message);
     }
 }