示例#1
0
        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();
        }
示例#2
0
        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);
        }