public PopulateDataPartitionFilterAttributeTests()
        {
            _controllerActionDescriptor = new ControllerActionDescriptor
            {
                DisplayName        = "Executing Context Test Descriptor",
                ActionName         = ActionName,
                ControllerName     = ControllerName,
                AttributeRouteInfo = new AttributeRouteInfo
                {
                    Name = RouteName,
                },
            };

            _httpContext = Substitute.For <HttpContext>();

            _actionExecutingContext = new ActionExecutingContext(
                new ActionContext(_httpContext, new RouteData(), _controllerActionDescriptor),
                new List <IFilterMetadata>(),
                new Dictionary <string, object>(),
                FilterTestsHelper.CreateMockRetrieveController());

            var routeValueDictionary = new RouteValueDictionary
            {
                { KnownActionParameterNames.StudyInstanceUid, "123" },
                { KnownActionParameterNames.PartitionName, DefaultPartition.Name },
            };

            _actionExecutingContext.RouteData = new RouteData(routeValueDictionary);

            _nextActionDelegate = Substitute.For <ActionExecutionDelegate>();

            _dicomRequestContextAccessor = Substitute.For <IDicomRequestContextAccessor>();

            _mediator = Substitute.For <IMediator>();
            _mediator.Send(Arg.Any <GetPartitionRequest>())
            .Returns(new GetPartitionResponse(new PartitionEntry(DefaultPartition.Key, DefaultPartition.Name)));

            _featureConfiguration = Options.Create(new FeatureConfiguration {
                EnableDataPartitions = true
            });

            _filterAttribute = new PopulateDataPartitionFilterAttribute(_dicomRequestContextAccessor, _mediator, _featureConfiguration);
        }
        public DicomRequestContextDataPopulatingFilterAttributeTests()
        {
            _controllerActionDescriptor = new ControllerActionDescriptor
            {
                DisplayName        = "Executing Context Test Descriptor",
                ActionName         = ActionName,
                ControllerName     = ControllerName,
                AttributeRouteInfo = new AttributeRouteInfo
                {
                    Name = RouteName,
                },
            };

            _actionExecutingContext = new ActionExecutingContext(
                new ActionContext(_httpContext, new RouteData(), _controllerActionDescriptor),
                new List <IFilterMetadata>(),
                new Dictionary <string, object>(),
                FilterTestsHelper.CreateMockRetrieveController());

            _dicomRequestContextAccessor.DicomRequestContext.Returns(_dicomRequestContext);

            _filterAttribute = new DicomRequestContextRouteDataPopulatingFilterAttribute(_dicomRequestContextAccessor, _auditEventTypeMapping);
        }