-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some infrastructure and coverage for ASP.NET models
Would have allowed us to catch issues like dotnet/aspnetcore#12097 Part of #11838 Ideally, we should reference the actual "product" assemblies, but this requires changes to dependencies that I don't want to take on write now. #11838 is still open to track improvements. I intend to add some more tests here before 3.0 to get some more coverage.
- Loading branch information
1 parent
aec9bcf
commit 4c0cb15
Showing
32 changed files
with
1,292 additions
and
5,195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/EFCore.InMemory.FunctionalTests/MusicStoreInMemoryTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using Microsoft.EntityFrameworkCore.TestUtilities; | ||
|
||
namespace Microsoft.EntityFrameworkCore | ||
{ | ||
// issue #15318 | ||
internal class MusicStoreInMemoryTest : MusicStoreTestBase<MusicStoreInMemoryTest.MusicStoreInMemoryFixture> | ||
{ | ||
public MusicStoreInMemoryTest(MusicStoreInMemoryFixture fixture) | ||
: base(fixture) | ||
{ | ||
} | ||
|
||
public class MusicStoreInMemoryFixture : MusicStoreFixtureBase | ||
{ | ||
protected override ITestStoreFactory TestStoreFactory => InMemoryTestStoreFactory.Instance; | ||
|
||
public override IDisposable BeginTransaction(DbContext context) => new InMemoryCleaner(context); | ||
|
||
private class InMemoryCleaner : IDisposable | ||
{ | ||
private readonly DbContext _context; | ||
public InMemoryCleaner(DbContext context) => _context = context; | ||
public void Dispose() => _context.Database.EnsureDeleted(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.