Пример #1
0
        public async Task ArrivalsControllerGetPassesRequestToService()
        {
            var request    = new StationBoardRequest();
            var service    = A.Fake <IStationBoardService>();
            var controller = new ArrivalsController(A.Fake <ILogger <ArrivalsController> >(), service);

            await controller.Get(request);

            A.CallTo(() => service.GetArrivalBoardAsync(request)).MustHaveHappenedOnceExactly();
        }
Пример #2
0
        public async Task ArrivalsControllerGetReturnsResponseFromService()
        {
            var request  = new StationBoardRequest();
            var response = new BaseStationBoard();
            var service  = A.Fake <IStationBoardService>();

            A.CallTo(() => service.GetArrivalBoardAsync(request)).Returns(response);
            var controller = new ArrivalsController(A.Fake <ILogger <ArrivalsController> >(), service);

            var board = await controller.Get(request);

            Assert.Equal(response, board);
        }