コード例 #1
0
        public void CanAddDivisionToLeague()
        {
            var request = new AddDivisionToLeagueRequest { DivisionId = "D1", LeagueId = "League" };
            var league = new League();
            _leagueRepo.Setup(x => x.GetById(request.LeagueId)).Returns(league);

            var response = _handle.Handle(request);

            Assert.That(response.Status, Is.EqualTo(ResponseCodes.Success));
            _leagueRepo.Verify(x => x.AddDivisionToLeague(league,
                request.DivisionId));
        }
コード例 #2
0
        public void CanNotAddADivisionTwice()
        {
            var request = new AddDivisionToLeagueRequest { DivisionId = "D1", LeagueId = "League" };
            var league = new League();
            league.DivisionIds.Add(request.DivisionId);
            _leagueRepo.Setup(x => x.GetById(request.LeagueId)).Returns(league);

            var response = _handle.Handle(request);

            Assert.That(response.Status, Is.EqualTo(ResponseCodes.AlreadyInLeague));
            _leagueRepo.Verify(x => x.AddDivisionToLeague(league,
                request.DivisionId), Times.Never());
        }
コード例 #3
0
ファイル: LeagueTests.cs プロジェクト: simtay111/TheRealDeal
        public void HoldsAListOfSubLeagues()
        {
            var league = new League();

            Assert.That(league.DivisionIds, Is.Empty);
        }