public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddSingleton <LyricPermissionProvider>();
                services.AddResourceDefinition <LyricTextDefinition>();
                services.AddScoped(typeof(IResourceChangeTracker <>), typeof(NeverSameResourceChangeTracker <>));
            });
        }
        public AtomicQueryStringTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
            testContext.UseController <MusicTracksController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddSingleton <ISystemClock>(new FrozenSystemClock
                {
                    UtcNow = FrozenTime
                });

                services.AddScoped <IResourceDefinition <MusicTrack, Guid>, MusicTrackReleaseDefinition>();
            });

            var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService <IJsonApiOptions>();

            options.AllowQueryStringOverrideForSerializerDefaultValueHandling = true;
            options.AllowQueryStringOverrideForSerializerNullValueHandling    = true;
        }
        public MultiTenancyTests(ExampleIntegrationTestContext <TestableStartup <MultiTenancyDbContext>, MultiTenancyDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <WebShopsController>();
            testContext.UseController <WebProductsController>();

            testContext.ConfigureServicesBeforeStartup(services =>
            {
                services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
                services.AddScoped <ITenantProvider, RouteTenantProvider>();
            });

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddResourceService <MultiTenantResourceService <WebShop> >();
                services.AddResourceService <MultiTenantResourceService <WebProduct> >();
            });

            var options = (JsonApiOptions)_testContext.Factory.Services.GetRequiredService <IJsonApiOptions>();

            options.UseRelativeLinks = true;
        }
Beispiel #4
0
        public FireForgetTests(ExampleIntegrationTestContext <TestableStartup <FireForgetDbContext>, FireForgetDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <DomainUsersController>();
            testContext.UseController <DomainGroupsController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddResourceDefinition <FireForgetUserDefinition>();
                services.AddResourceDefinition <FireForgetGroupDefinition>();

                services.AddSingleton <MessageBroker>();
                services.AddSingleton <ResourceDefinitionHitCounter>();
            });

            var messageBroker = _testContext.Factory.Services.GetRequiredService <MessageBroker>();

            messageBroker.Reset();

            var hitCounter = _testContext.Factory.Services.GetRequiredService <ResourceDefinitionHitCounter>();

            hitCounter.Reset();
        }
        public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext <TestableStartup <CallableDbContext>, CallableDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <CallableResourcesController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddResourceDefinition <CallableResourceDefinition>();
                services.AddSingleton <IUserRolesService, FakeUserRolesService>();
            });

            var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService <IJsonApiOptions>();

            options.IncludeTotalResourceCount = true;
        }
Beispiel #6
0
        public AtomicResourceMetaTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddResourceDefinition <MusicTrackMetaDefinition>();
                services.AddResourceDefinition <TextLanguageMetaDefinition>();

                services.AddSingleton <ResourceDefinitionHitCounter>();
            });

            var hitCounter = _testContext.Factory.Services.GetRequiredService <ResourceDefinitionHitCounter>();

            hitCounter.Reset();
        }
        public AtomicSerializationResourceDefinitionTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddResourceDefinition <RecordCompanyDefinition>();

                services.AddSingleton <ResourceDefinitionHitCounter>();
                services.AddScoped(typeof(IResourceChangeTracker <>), typeof(NeverSameResourceChangeTracker <>));
            });

            var hitCounter = _testContext.Factory.Services.GetRequiredService <ResourceDefinitionHitCounter>();

            hitCounter.Reset();
        }
        public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();

            testContext.ConfigureServicesAfterStartup(services =>
            {
                services.AddResourceRepository <PerformerRepository>();
                services.AddResourceRepository <MusicTrackRepository>();
                services.AddResourceRepository <LyricRepository>();

                string postgresPassword   = Environment.GetEnvironmentVariable("PGPASSWORD") ?? "postgres";
                string dbConnectionString = $"Host=localhost;Port=5432;Database=JsonApiTest-{Guid.NewGuid():N};User ID=postgres;Password={postgresPassword}";

                services.AddDbContext <ExtraDbContext>(options => options.UseNpgsql(dbConnectionString));
            });
        }
        public NoHttpPostTests(ExampleIntegrationTestContext <TestableStartup <RestrictionDbContext>, RestrictionDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <BlockingHttpPostController>();
        }
Beispiel #10
0
        public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
        }
Beispiel #11
0
        public AtomicModelStateValidationTests(ExampleIntegrationTestContext <ModelStateValidationStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
        }
        public ApiControllerAttributeTests(ExampleIntegrationTestContext <TestableStartup <CustomRouteDbContext>, CustomRouteDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <CiviliansController>();
        }
Beispiel #13
0
        public ActionResultTests(ExampleIntegrationTestContext <TestableStartup <ActionResultDbContext>, ActionResultDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <ToothbrushesController>();
        }
        public AtomicRequestBodyTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
        }
        public LinkInclusionTests(ExampleIntegrationTestContext <TestableStartup <LinksDbContext>, LinksDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <PhotoLocationsController>();
        }
        public AtomicDeleteResourceTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
        }
        public InheritanceTests(ExampleIntegrationTestContext <TestableStartup <InheritanceDbContext>, InheritanceDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <MenController>();
        }
Beispiel #18
0
        public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
        }
        public QueryStringTests(ExampleIntegrationTestContext <TestableStartup <QueryStringDbContext>, QueryStringDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <CalendarsController>();
        }
Beispiel #20
0
        public HttpReadOnlyTests(ExampleIntegrationTestContext <TestableStartup <RestrictionDbContext>, RestrictionDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <BlockingWritesController>();
        }
Beispiel #21
0
        public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext <TestableStartup <ReadWriteDbContext>, ReadWriteDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <WorkItemsController>();
        }
        public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <OperationsController>();
        }
Beispiel #23
0
        public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext <TestableStartup <QueryStringDbContext>, QueryStringDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <CalendarsController>();
        }
Beispiel #24
0
        public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext <TestableStartup <OperationsDbContext>, OperationsDbContext> testContext)
        {
            _testContext = testContext;

            testContext.UseController <CreateMusicTrackOperationsController>();
        }