コード例 #1
0
        public async Task GivenRouteNameSet_WhenInvoked_ThenAuditLogShouldNotBeLogged()
        {
            _fhirRequestContext.RouteName.Returns("route");

            await _auditMiddleware.Invoke(_httpContext);

            _auditHelper.DidNotReceiveWithAnyArgs().LogExecuted(null, null, HttpStatusCode.OK, null);
        }
コード例 #2
0
        public async Task GivenSuccess_WhenInvoked_ThenAuditLogShouldBeLogged()
        {
            _httpContext.Response.StatusCode = (int)HttpStatusCode.OK;

            await _auditMiddleware.Invoke(_httpContext);

            _auditHelper.Received(1).LogExecuted(_httpContext, _claimsExtractor, shouldCheckForAuthXFailure: true);
        }
コード例 #3
0
        public async Task GivenRouteNameSet_WhenInvoked_ThenAuditLogShouldNotBeLogged()
        {
            _fhirRequestContext.RouteName.Returns("route");

            await _auditMiddleware.Invoke(_httpContext);

            _auditHelper.DidNotReceiveWithAnyArgs().LogExecuted(
                controllerName: default,
コード例 #4
0
        public async Task GivenNotAuthXFailure_WhenInvoked_ThenAuditLogShouldNotBeLogged()
        {
            _httpContext.Response.StatusCode = (int)HttpStatusCode.OK;

            await _auditMiddleware.Invoke(_httpContext);

            _auditHelper.DidNotReceiveWithAnyArgs().LogExecuted(
                httpContext: default,