public async Task GivenRouteNameSet_WhenInvoked_ThenAuditLogShouldNotBeLogged() { _fhirRequestContext.RouteName.Returns("route"); await _auditMiddleware.Invoke(_httpContext); _auditHelper.DidNotReceiveWithAnyArgs().LogExecuted(null, null, HttpStatusCode.OK, null); }
public async Task GivenSuccess_WhenInvoked_ThenAuditLogShouldBeLogged() { _httpContext.Response.StatusCode = (int)HttpStatusCode.OK; await _auditMiddleware.Invoke(_httpContext); _auditHelper.Received(1).LogExecuted(_httpContext, _claimsExtractor, shouldCheckForAuthXFailure: true); }
public async Task GivenRouteNameSet_WhenInvoked_ThenAuditLogShouldNotBeLogged() { _fhirRequestContext.RouteName.Returns("route"); await _auditMiddleware.Invoke(_httpContext); _auditHelper.DidNotReceiveWithAnyArgs().LogExecuted( controllerName: default,
public async Task GivenNotAuthXFailure_WhenInvoked_ThenAuditLogShouldNotBeLogged() { _httpContext.Response.StatusCode = (int)HttpStatusCode.OK; await _auditMiddleware.Invoke(_httpContext); _auditHelper.DidNotReceiveWithAnyArgs().LogExecuted( httpContext: default,