public async Task DelaysControllerGetPassesRequestToService() { var request = new StationBoardRequest(); var service = A.Fake <IDelaysService>(); var controller = new DelaysController(A.Fake <ILogger <DelaysController> >(), service); await controller.Get(request); A.CallTo(() => service.GetDelaysAsync(request)).MustHaveHappenedOnceExactly(); }
public async Task DelaysControllerGetReturnsResponseFromService() { var request = new StationBoardRequest(); var response = new DelaysResponse(); var service = A.Fake <IDelaysService>(); A.CallTo(() => service.GetDelaysAsync(request)).Returns(response); var controller = new DelaysController(A.Fake <ILogger <DelaysController> >(), service); var board = await controller.Get(request); Assert.Equal(response, board); }