public MatchButtonViewModel(IFootballRepository footballRepository, MatchViewModel matchViewModel, IDialogSelectionService dialogSelectionService) { _footballRepository = footballRepository; _matchViewModel = matchViewModel; _dialogSelectionService = dialogSelectionService; _canExecute = true; }
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 MatchViewModel_WhenAMatchIsSelectedPlayerMatchesIsPopulatedOnPlayerMatchViewModel() { //Arrange var matchViewModel = new MatchViewModel(fakeFootballRepo); matchViewModel.PlayerMatchViewModel = playerMatchViewModel; matchViewModel.ButtonViewModel = buttonViewModel; //Act matchViewModel.SelectedMatch = fakeFootballRepo.GetMatches().First(); //Assert Assert.That(matchViewModel.PlayerMatchViewModel.PlayerMatches.Count, Is.GreaterThan(0)); }
public void MatchViewModel_WhenAMatchIsSelectedSelectedMatchIsPopulatedOnButtonViewModel() { //Arrange var matchViewModel = new MatchViewModel(fakeFootballRepo); var selectedMatch = fakeFootballRepo.GetMatches().First(); matchViewModel.PlayerMatchViewModel = playerMatchViewModel; matchViewModel.ButtonViewModel = buttonViewModel; //Act matchViewModel.SelectedMatch = selectedMatch; //Assert Assert.That(matchViewModel.ButtonViewModel.SelectedMatch, Is.EqualTo(selectedMatch)); }