public void WhenConstructedWithNullRepository_ThenThrows() { // Arrange Mock <IFightStrategy> mockFightStrategy = new Mock <IFightStrategy>(); ISuperRepository repository = null; IFightStrategy fightStrategy = mockFightStrategy.Object; // Act ChallengeArena actual = new ChallengeArena(repository, fightStrategy); // Assert }
public void WhenConstructed_ThenInitialized() { // Arrange Mock <ISuperRepository> mockRepository = new Mock <ISuperRepository>(); Mock <IFightStrategy> mockFightStrategy = new Mock <IFightStrategy>(); ISuperRepository repository = mockRepository.Object; IFightStrategy fightStrategy = mockFightStrategy.Object; // Act ChallengeArena actual = new ChallengeArena(repository, fightStrategy); // Assert Assert.IsNotNull(actual); }
public ChallengeArena(ISuperRepository repository, IFightStrategy fightStrategy) { if (repository == null) { throw new ArgumentNullException("repository"); } if (fightStrategy == null) { throw new ArgumentNullException("fightStrategy"); } this.repository = repository; this.fightStrategy = fightStrategy; this.Heroes = new ObservableCollection <SuperPerson>(); this.Villians = new ObservableCollection <SuperPerson>(); this.fightStrategy.Started += this.FightStrategy_Started; this.fightStrategy.Completed += this.FightStrategy_Completed; }
public ProposalController(ISuperRepository repository) { _repository = repository; }