public void TestMethod1() { IFootballTeamsRepository repository = new FootballTeamsRepository(); repository.DataSource = DataStore; var footballTeamData = repository.RetrieveFootbalTeamsData(); Assert.AreEqual(footballTeamData.Count, 20); }
private void MimicIOCContainer() { //Here we can choose which instance to instatntiate .e.g instead of FootballTeamsRepository //we could have chosen MockFootballTeamsRepository IFootballTeamsRepository footballTeamsRepository = new FootballTeamsRepository(); // IFootballTeamsRepository footballTeamsRepository = new MockFootballTeamsRepository(); footballTeamsRepository.DataSource = ConfigurationManager.AppSettings["FootballDBlocation"]; IFootBallTeamService footballBl = new FootBallTeamService(footballTeamsRepository); footballTeamsViewModel = new FootballTeamsViewModel(); footballTeamsViewModel.FootBallTeamService = footballBl; }