public async Task Should_create_temp_table_for_queryType() { ConfigureModel = builder => builder.ConfigureTempTableEntity <CustomTempTable>(); // ReSharper disable once RedundantArgumentDefaultValue await _sut.CreateTempTableAsync(ActDbContext, ActDbContext.GetEntityType <CustomTempTable>(), new TempTableCreationOptions()).ConfigureAwait(false); var columns = AssertDbContext.GetCustomTempTableColumns <CustomTempTable>().ToList(); columns.Should().HaveCount(2); ValidateColumn(columns[0], nameof(CustomTempTable.Column1), "int", false); ValidateColumn(columns[1], nameof(CustomTempTable.Column2), "nvarchar", true); }
public async Task Should_create_temp_table_for_entityType() { // ReSharper disable once RedundantArgumentDefaultValue await _sut.CreateTempTableAsync(ActDbContext, ActDbContext.GetEntityType <TestEntity>(), new TempTableCreationOptions()).ConfigureAwait(false); var columns = AssertDbContext.GetCustomTempTableColumns <TestEntity>().OrderBy(c => c.COLUMN_NAME).ToList(); columns.Should().HaveCount(6); ValidateColumn(columns[0], "_privateField", "int", false); ValidateColumn(columns[1], nameof(TestEntity.Count), "int", false); ValidateColumn(columns[2], nameof(TestEntity.Id), "uniqueidentifier", false); ValidateColumn(columns[3], nameof(TestEntity.Name), "nvarchar", true); ValidateColumn(columns[4], nameof(TestEntity.PropertyWithBackingField), "int", false); ValidateColumn(columns[5], "ShadowProperty", "nvarchar", true); }