public void TestForNumberOfRecord() { //call the readmethod and it return the number of record int record = read.ReadMethod(','); Assert.AreEqual(29, record); }
public void TestForNumberOfRecordincsvStateCode() { //call the readmethod and it return the number of record int record = ReadForCsvStateCode.ReadMethod(','); Assert.AreEqual(37, record); }
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); } }
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); } }
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); } }
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); } }