Example #1
0
 public OperationsTestBase(RESTableFixture fixture)
 {
     Resource = fixture.ServiceProvider
                .GetRequiredService <ResourceCollection>()
                .GetResource <TResourceType>() as IEntityResource <TResourceType>;
     OperationsTestsFlags = fixture.OperationsTestsFlags;
     OperationsTestsFlags.Reset();
     Request = fixture.Context.CreateRequest <TResourceType>();
 }
Example #2
0
        public RESTableFixture()
        {
            OperationsTestsFlags = new OperationsTestsFlags();
            ServiceProvider      = new ServiceCollection()
                                   .AddRESTable()
                                   .AddJsonProvider()
                                   .AddSingleton(OperationsTestsFlags)
                                   .BuildServiceProvider();
            Configurator = ServiceProvider
                           .GetRequiredService <RESTableConfigurator>();
            var client = ServiceProvider.GetRequiredService <RootClient>();

            Context = new RESTableContext(client, ServiceProvider);
            Configurator.ConfigureRESTable();
        }