コード例 #1
0
ファイル: TableOrder.cs プロジェクト: kosist/crudmvctable
        public void SetUp()
        {
            var fixture = new TestFixture();

            fixture.AddMappingProfile <TableMappingProfile>();

            if (UseInMemoryDb)
            {
                fixture.UseInMemoryDatabase <TableTestContext>();
            }
            else
            {
                fixture.UseDatabase <TableTestContext>();
            }

            fixture.Initialize();

            Context = fixture.GetService <TableTestContext>();

            Context.Database.EnsureDeleted();

            Context.Database.EnsureCreated();

            TableOrderTestDataInitializer.Init(Context);
        }
コード例 #2
0
        public void SetUp()
        {
            var fixture = new TestFixture();

            fixture.AddMappingProfile <GenericInfrastructureMappingProfile>();

            if (UseInMemoryDb)
            {
                fixture.UseInMemoryDatabase <GenericInfrastructureContext>();
            }
            else
            {
                fixture.UseDatabase <GenericInfrastructureContext>();
            }

            fixture.Services.AddScoped <TestRepository>();

            fixture.Initialize();

            Context = fixture.GetService <GenericInfrastructureContext>();

            Context.Database.EnsureDeleted();

            Context.Database.EnsureCreated();

            GenericInfrastructureDataInitializer.Init(Context);

            Repository = fixture.GetService <TestRepository>();
        }
コード例 #3
0
        public void SetUp()
        {
            var fixture = new TestFixture();

            fixture.AddMappingProfile <TableMappingProfile>();

            fixture.UseInMemoryDatabase <TableTestContext>();

            fixture.Initialize();

            Context = fixture.GetService <TableTestContext>();

            TableFilterTestDataInitializer.Init(Context);
        }