You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EntityFrameworkCore.Jet/test/EFCore.Jet.FunctionalTests/ConcurrencyDetectorDisabled...

41 lines
1.4 KiB
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Threading.Tasks;
using EntityFrameworkCore.Jet.FunctionalTests.TestUtilities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.TestUtilities;
using Xunit;
namespace EntityFrameworkCore.Jet.FunctionalTests;
public class ConcurrencyDetectorDisabledJetTest : ConcurrencyDetectorDisabledRelationalTestBase<
ConcurrencyDetectorDisabledJetTest.ConcurrencyDetectorJetFixture>
{
public ConcurrencyDetectorDisabledJetTest(ConcurrencyDetectorJetFixture fixture)
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
}
protected override async Task ConcurrencyDetectorTest(Func<ConcurrencyDetectorDbContext, Task<object>> test)
{
await base.ConcurrencyDetectorTest(test);
Assert.NotEmpty(Fixture.TestSqlLoggerFactory.SqlStatements);
}
public class ConcurrencyDetectorJetFixture : ConcurrencyDetectorFixtureBase
{
protected override ITestStoreFactory TestStoreFactory
=> JetTestStoreFactory.Instance;
public TestSqlLoggerFactory TestSqlLoggerFactory
=> (TestSqlLoggerFactory)ListLoggerFactory;
public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder)
=> builder.EnableThreadSafetyChecks(enableChecks: false);
}
}