public void MustReturnRefereeIfExistsOrEmptyRefereeObjectIfIdIsInvalid(int id) { RefereesController refereesController = new RefereesController(Mocked()); var referee = refereesController.GetRefereeByID(id); Assert.IsNotNull(referee); Assert.IsInstanceOf <Referee>(referee); Assert.AreEqual(id, referee.ID); }
public void MustReturnEmptyRefereeObjectIfAnyArgumentIsInvalid(string name) { RefereesController refereesController = new RefereesController(Mocked()); var referee = refereesController.GetRefereeByName(name); Assert.IsNotNull(referee); Assert.IsInstanceOf <Referee>(referee); Assert.AreEqual(0, referee.ID); }
public void MustReturnRefereeIfArgumentIsValid(string name) { RefereesController refereesController = new RefereesController(Mocked()); var referee = refereesController.GetRefereeByName(name); Assert.IsNotNull(referee); Assert.IsInstanceOf <Referee>(referee); Assert.AreEqual(1, referee.ID); Assert.AreEqual(name, referee.RefereeName); }
public void Initialize() { this.service = new Mock <ILeagueService>(); this.controller = new RefereesController(service.Object); this.request = new HttpRequestMessage(); request.SetConfiguration(new System.Web.Http.HttpConfiguration()); Mapper.Initialize(x => { x.AddProfile <DomainToViewModelMappingProfile>(); }); }