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