public async Task FastestControllerGetPassesRequestToService() { var request = new StationBoardRequest(); var service = A.Fake <IStationBoardService>(); var controller = new FastestController(A.Fake <ILogger <FastestController> >(), service); await controller.Get(request); A.CallTo(() => service.GetFastestDeparturesAsync(request)).MustHaveHappenedOnceExactly(); }
public async Task FastestControllerGetReturnsResponseFromService() { var request = new StationBoardRequest(); var response = new BaseStationBoard(); var service = A.Fake <IStationBoardService>(); A.CallTo(() => service.GetFastestDeparturesAsync(request)).Returns(response); var controller = new FastestController(A.Fake <ILogger <FastestController> >(), service); var board = await controller.Get(request); Assert.Equal(response, board); }