public void GivenStateCensusDataInJsonFromLargestStateToSmallest_WhenAnalyse_ReturnNumberOfStatesSorted() { StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer(); int actual = stateCensusAnalyzer.SortingByInt(stateCensusDataPath, 2); Assert.AreEqual(336, actual); }
public void GivenStateCensusDataInJsonFromMostDensityToLeast_WhenAnalyse_ReturnNumberOfStatesSorted() { StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer(); int actual = stateCensusAnalyzer.SortingByInt(stateCensusDataPath, 3); Assert.AreEqual(294, actual); }
public void GivenCSVStateCodeCheckEndState_WhenAnalyze_ShouldMatch() { StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer(); string actual = stateCensusAnalyzer.CheckForState(this.jsonStateCodePath, "Last", "StateName", "StateCode"); Assert.AreEqual("West Bengal", actual); }
public void GivenCSVStateCodeCheckStartState_WhenAnalyze_ShouldMatch() { StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer(); string actual = stateCensusAnalyzer.CheckForState(this.jsonStateCodePath, "First", "StateName", "StateCode"); Assert.AreEqual("Andaman and Nicobar Islands", actual); }
public void GivenCSVStateCensusAnalyzerCheckStartState_WhenAnalyze_ShouldMatch() { StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer(); string actual = stateCensusAnalyzer.CheckForState(this.jsonStateCensusPath, "First", "State", "StateCensusData"); Assert.AreEqual("Andhra Pradesh", actual); }
public void GivenStateCodeCSVFile_WhenAnalyze_NumberOfRecordMatches() { StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer(this.stateCodePath); Factory factory = new ObjectFactory(); ICSVBuilder csvStates = factory.GetObject("CSVStateCensus", this.stateCodePath, this.delimiter, this.csvStateCodeHeader); GetCSVData getCSVData = new GetCSVData(csvStates.NumberOfRecords); string expected = getCSVData.Invoke(); string actual = stateCensusAnalyzer.NumberOfRecords(); Assert.AreEqual(expected, actual); }