public void CanAddATeamToDivision()
        {
            var request = new AddTeamToDivisionRequest {TeamId = "12345", DivisionId = "DivId"};
            var division = new Division();
            _divisionRepo.Setup(x => x.GetById(request.DivisionId)).Returns(division);

            var response = _handle.Handle(request);

            Assert.That(response.Status, Is.EqualTo(ResponseCodes.Success));
            _divisionRepo.Verify(x => x.AddTeamToDivision(division, request.TeamId));
        }
        public void CannotAddATeamToDivisionTwice()
        {
            var request = new AddTeamToDivisionRequest { TeamId = "12345", DivisionId = "DivId" };
            var division = new Division();
            division.TeamIds.Add(request.TeamId);
            _divisionRepo.Setup(x => x.GetById(request.DivisionId)).Returns(division);

            var response = _handle.Handle(request);

            Assert.That(response.Status, Is.EqualTo(ResponseCodes.DuplicateEntryFound));
            _divisionRepo.Verify(x => x.AddTeamToDivision(division, request.TeamId), Times.Never());
        }
예제 #3
0
 public void HasName()
 {
     var division = new Division();
     division.Name = "moo";
 }
예제 #4
0
 public void HasId()
 {
     var division = new Division();
     Assert.That(division.Id, Is.Not.Null.Or.Empty);
 }