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()); }