Пример #1
0
        public void VerifiesTiedMatch()
        {
            var repository = Repository.CreatePopulatedRepository();
            var service = new MatchService(repository, null);

            repository.GetMatchById(1).Tied = true;
            
            service.VerifyMatch(1);

            var match = repository.GetMatchById(1);

            Assert.That(match.Verified, Is.True);
            Assert.That(match.Resolved, Is.Not.Null);

            Assert.That(match.Loser.Wins, Is.EqualTo(0));
            Assert.That(match.Loser.Streak, Is.EqualTo(0));
            Assert.That(match.Loser.Loses, Is.EqualTo(0));
            Assert.That(match.Loser.Ties, Is.EqualTo(1));

            Assert.That(match.Winner.Wins, Is.EqualTo(0));
            Assert.That(match.Winner.Streak, Is.EqualTo(0));
            Assert.That(match.Winner.Loses, Is.EqualTo(0));
            Assert.That(match.Winner.Ties, Is.EqualTo(1));
        }
Пример #2
0
        public void ThrowsIfMatchNotFound()
        {
            var repository = Repository.CreatePopulatedRepository();
            var service = new MatchService(repository, null);

            Assert.Throws<ServiceException>(() => service.VerifyMatch(100));
        }