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