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