public void PostConcert_Returns_Concert() { var concertResponse = ConcertTestData.GetCreatedConcert(); var response = _controller.CreateConcert(true, _concert); Assert.IsTrue(DeepEqualityComparer.AreEqual(concertResponse, response.Concert)); }
public void Intialize() { _concertService = new Mock <IConcertService>(); _tweetService = new Mock <ITweetService>(); _controller = new ConcertsController(_concertService.Object, _tweetService.Object); _request = new HttpRequestMessage(); _request.Headers.Add("app_id", "testapp"); _request.Headers.Add("user", "testuser"); _controller.Request = _request; _concertService.Setup(s => s.GetConcerts(It.IsAny <string>())) .Returns(() => new ConcertsResponse { Concerts = ConcertTestData.GetAllConcerts() }); }
public void Intialize() { _concertService = new Mock <IConcertService>(); _tweetService = new Mock <ITweetService>(); _controller = new ConcertsController(_concertService.Object, _tweetService.Object); _request = new HttpRequestMessage(); _request.Headers.Add("app_id", "testapp"); _request.Headers.Add("user", "testuser"); _controller.Request = _request; _concertService.Setup(s => s.CreateConcert(It.IsAny <string>(), It.IsAny <Concert>())) .Returns(() => new CreateUpdateConcertResponse { RequestId = _requestId, Concert = ConcertTestData.GetCreatedConcert(), }); _tweetService.Setup(s => s.TweetConcert(It.IsAny <Concert>())) .Returns(() => _tweetUrl); _concert = ConcertTestData.GetConcertToCreate(); }