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