public async void ControllerDelegatesRequestsToDownStreamServicesWhenRequestIsValid() { var mockApiService = new Mock <IBoqApiService>(); mockApiService.Setup(api => api.GetSession(It.IsAny <int>())); var controller = new DemoController(mockApiService.Object); await controller.GetSession(1); mockApiService.Verify(mock => mock.GetSession(It.IsAny <int>()), Times.Once); }
public void ControllerThrowsErrorForInvalidSessionId() { var controller = new DemoController(null); Assert.ThrowsAsync <InvalidSessionError>(async() => await controller.GetSession(-1)); }