Skip to content

Commit

Permalink
#1834 make required and more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Nov 16, 2024
1 parent e41874b commit d559ede
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task AddNotification_ShouldHandleUniqueConstraintError()
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
.UseInMemoryDatabase(nameof(AddNotification_ShouldHandleUniqueConstraintError))
.Options;
var context = new DbUpdateExceptionException(options)
var context = new DbUpdateExceptionApplicationDbContext(options)
{
MinCount = 1, InnerException = new SqliteException("t", 19, 19)
};
Expand All @@ -93,7 +93,7 @@ public async Task AddNotification_ShouldHandleUniqueConstraintError()
Assert.IsNotNull(result);
Assert.AreEqual(content, result.Content);
}

[TestMethod]
public async Task AddNotification_ShouldRetry_GeneralException()
{
Expand All @@ -102,7 +102,7 @@ public async Task AddNotification_ShouldRetry_GeneralException()
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
.UseInMemoryDatabase(nameof(AddNotification_ShouldHandleUniqueConstraintError))
.Options;
var context = new DbUpdateExceptionException(options)
var context = new DbUpdateExceptionApplicationDbContext(options)
{
MinCount = 1, InnerException = new AggregateException("test")
};
Expand Down Expand Up @@ -205,14 +205,14 @@ public bool IsConceptualNull(IProperty property)
#pragma warning restore 8618
}

private class DbUpdateExceptionException(DbContextOptions options)
private class DbUpdateExceptionApplicationDbContext(DbContextOptions options)
: ApplicationDbContext(options)
{
public int MinCount { get; set; }
public required int MinCount { get; set; }

private int Count { get; set; }

public Exception InnerException { get; set; }
public required Exception InnerException { get; set; }

public override Task<int> SaveChangesAsync(
CancellationToken cancellationToken = default)
Expand Down

0 comments on commit d559ede

Please sign in to comment.