Beispiel #1
0
        public void GivenStateCensusDataInJsonFromLargestStateToSmallest_WhenAnalyse_ReturnNumberOfStatesSorted()
        {
            StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer();
            int actual = stateCensusAnalyzer.SortingByInt(stateCensusDataPath, 2);

            Assert.AreEqual(336, actual);
        }
Beispiel #2
0
        public void GivenStateCensusDataInJsonFromMostDensityToLeast_WhenAnalyse_ReturnNumberOfStatesSorted()
        {
            StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer();
            int actual = stateCensusAnalyzer.SortingByInt(stateCensusDataPath, 3);

            Assert.AreEqual(294, actual);
        }
Beispiel #3
0
        public void GivenCSVStateCodeCheckEndState_WhenAnalyze_ShouldMatch()
        {
            StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer();
            string actual = stateCensusAnalyzer.CheckForState(this.jsonStateCodePath, "Last", "StateName", "StateCode");

            Assert.AreEqual("West Bengal", actual);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public void GivenCSVStateCensusAnalyzerCheckStartState_WhenAnalyze_ShouldMatch()
        {
            StateCensusAnalyzer stateCensusAnalyzer = new StateCensusAnalyzer();
            string actual = stateCensusAnalyzer.CheckForState(this.jsonStateCensusPath, "First", "State", "StateCensusData");

            Assert.AreEqual("Andhra Pradesh", actual);
        }
Beispiel #6
0
        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);
        }