Exemple #1
0
        public async Task DelaysControllerGetPassesRequestToService()
        {
            var request    = new StationBoardRequest();
            var service    = A.Fake <IDelaysService>();
            var controller = new DelaysController(A.Fake <ILogger <DelaysController> >(), service);

            await controller.Get(request);

            A.CallTo(() => service.GetDelaysAsync(request)).MustHaveHappenedOnceExactly();
        }
Exemple #2
0
        public async Task DelaysControllerGetReturnsResponseFromService()
        {
            var request  = new StationBoardRequest();
            var response = new DelaysResponse();
            var service  = A.Fake <IDelaysService>();

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

            var board = await controller.Get(request);

            Assert.Equal(response, board);
        }