public void Init()
 {
     fakeFootballRepo = new FootballRepository();
     fakePlayerRepo = new FakePlayerRepository();
     playerValidatorService = new PlayerValidatorService(new FakeDialogService());
     playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);
     playerViewModel = new PlayerViewModel(fakeFootballRepo, playerMatchViewModel, playerValidatorService);
 }
 public void Init()
 {
     fakeFootballRepo = new FootballRepository();
     fakePlayerMatchRepo = new FakePlayerMatchRepository();
     playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);
     matchValidatorService = new MatchValidatorService(playerMatchViewModel, new FakeDialogService());
     mailerService = new MailerService(playerMatchViewModel,fakeFootballRepo);
     buttonViewModel = new ButtonViewModel(fakeFootballRepo, playerMatchViewModel, matchValidatorService, mailerService);
 }
 public void Init()
 {
     fakeFootballRepo = new FootballRepository();
     fakeMatchRepo = new FakeMatchRepository();
     matchViewModel = new MatchViewModel(fakeFootballRepo);
     playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);
     matchButtonViewModel = new MatchButtonViewModel(fakeFootballRepo, matchViewModel, new FakeDialogSelectionService());
     fakeMailerService = new MailerService(playerMatchViewModel, fakeFootballRepo);
     buttonViewModel = new ButtonViewModel(fakeFootballRepo, playerMatchViewModel, new FakeMatchValidatorService(true), fakeMailerService);
     matchViewModel.PlayerMatchViewModel = playerMatchViewModel;
     matchViewModel.ButtonViewModel = buttonViewModel;
 }
        public void PlayerMatchViewModel_WhenGetTeamsIsCalledReturnsListOfTwoTeams()
        {
            //Arrange
            var fakeFootballRepo = new FootballRepository();
            var playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);

            //Act
            var result = playerMatchViewModel.GetTeams();

            //Assert
            Assert.That(result.Count, Is.EqualTo(2));
        }
        public void PlayerMatchViewModel_WhenGetPlayerMatchesIsCalledReturnsListOfPlayerMatchesForThatMatch()
        {
            //Arrange
            var fakeFootballRepo = new FootballRepository();
            var playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);

            //Act
            var result = playerMatchViewModel.GetPlayerMatches(1);

            //Assert
            Assert.That(result.Count, Is.GreaterThan(0));
        }
        public void PlayerMatchViewModel_WhenGetPlayerMatchesIsCalledDoesntReturnPlayerMatchForAnotherMatch()
        {
            //Arrange
            var fakeFootballRepo = new FootballRepository();
            var playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);

            //Act
            var result = playerMatchViewModel.GetPlayerMatches(1);

            //Assert
            Assert.That(result.Where(x => x.MatchID != 1), Is.Empty);
        }
        public void PlayerMatchViewModel_WhenGetActivePlayersIsCalledReturnsOnlyActivePlayers()
        {
            //Arrange
            var fakeFootballRepo = new FootballRepository();
            var playerMatchViewModel = new PlayerMatchViewModel(fakeFootballRepo);

            //Act
            var result = playerMatchViewModel.GetActivePlayers();

            //Assert
            Assert.That(result.Where(x => x.Active == false), Is.Empty);
        }