This commit is contained in:
GitHub Action 2021-10-14 04:37:21 +00:00
Родитель 5bb162bf18
Коммит 7ed200aa35
1 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -28,7 +28,7 @@ Enable VerifyEntityFramework once at assembly load time:
```cs ```cs
VerifyEntityFramework.Enable(); VerifyEntityFramework.Enable();
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L344-L348' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablecore' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L341-L345' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablecore' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
@ -39,7 +39,7 @@ VerifyEntityFramework.Enable();
```cs ```cs
VerifyEntityFrameworkClassic.Enable(); VerifyEntityFrameworkClassic.Enable();
``` ```
<sup><a href='/src/Verify.EntityFrameworkClassic.Tests/ClassicTests.cs#L137-L141' title='Snippet source file'>snippet source</a> | <a href='#snippet-enableclassic' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFrameworkClassic.Tests/ClassicTests.cs#L135-L139' title='Snippet source file'>snippet source</a> | <a href='#snippet-enableclassic' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
@ -60,7 +60,7 @@ builder.UseSqlServer(connection);
builder.EnableRecording(); builder.EnableRecording();
SampleDbContext data = new(builder.Options); SampleDbContext data = new(builder.Options);
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L202-L209' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablerecording' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L199-L206' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablerecording' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
`EnableRecording` should only be called in the test context. `EnableRecording` should only be called in the test context.
@ -88,7 +88,7 @@ await data.Companies
await Verifier.Verify(data.Companies.Count()); await Verifier.Verify(data.Companies.Count());
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L282-L299' title='Snippet source file'>snippet source</a> | <a href='#snippet-recording' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L279-L296' title='Snippet source file'>snippet source</a> | <a href='#snippet-recording' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
Will result in the following verified file: Will result in the following verified file:
@ -145,7 +145,7 @@ await Verifier.Verify(new
sql = entries sql = entries
}); });
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L308-L331' title='Snippet source file'>snippet source</a> | <a href='#snippet-recordingspecific' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L305-L328' title='Snippet source file'>snippet source</a> | <a href='#snippet-recordingspecific' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
@ -176,7 +176,7 @@ await data2.Companies
await Verifier.Verify(data2.Companies.Count()); await Verifier.Verify(data2.Companies.Count());
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L251-L273' title='Snippet source file'>snippet source</a> | <a href='#snippet-multidbcontexts' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L248-L270' title='Snippet source file'>snippet source</a> | <a href='#snippet-multidbcontexts' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
<!-- snippet: CoreTests.MultiDbContexts.verified.txt --> <!-- snippet: CoreTests.MultiDbContexts.verified.txt -->
@ -243,7 +243,7 @@ public async Task Added()
await Verifier.Verify(data.ChangeTracker); await Verifier.Verify(data.ChangeTracker);
} }
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L14-L30' title='Snippet source file'>snippet source</a> | <a href='#snippet-added' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L11-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-added' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
Will result in the following verified file: Will result in the following verified file:
@ -285,7 +285,7 @@ public async Task Deleted()
await Verifier.Verify(data.ChangeTracker); await Verifier.Verify(data.ChangeTracker);
} }
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L32-L48' title='Snippet source file'>snippet source</a> | <a href='#snippet-deleted' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L29-L45' title='Snippet source file'>snippet source</a> | <a href='#snippet-deleted' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
Will result in the following verified file: Will result in the following verified file:
@ -329,7 +329,7 @@ public async Task Modified()
await Verifier.Verify(data.ChangeTracker); await Verifier.Verify(data.ChangeTracker);
} }
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L50-L69' title='Snippet source file'>snippet source</a> | <a href='#snippet-modified' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L47-L66' title='Snippet source file'>snippet source</a> | <a href='#snippet-modified' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
Will result in the following verified file: Will result in the following verified file:
@ -364,7 +364,7 @@ var queryable = data.Companies
.Where(x => x.Content == "value"); .Where(x => x.Content == "value");
await Verifier.Verify(queryable); await Verifier.Verify(queryable);
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L180-L186' title='Snippet source file'>snippet source</a> | <a href='#snippet-queryable' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L177-L183' title='Snippet source file'>snippet source</a> | <a href='#snippet-queryable' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
Will result in the following verified file: Will result in the following verified file:
@ -412,7 +412,7 @@ await Verifier.Verify(data.AllData())
serializer => serializer =>
serializer.TypeNameHandling = TypeNameHandling.Objects)); serializer.TypeNameHandling = TypeNameHandling.Objects));
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L161-L170' title='Snippet source file'>snippet source</a> | <a href='#snippet-alldata' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L158-L167' title='Snippet source file'>snippet source</a> | <a href='#snippet-alldata' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->
Will result in the following verified file with all data in the database: Will result in the following verified file with all data in the database:
@ -496,7 +496,7 @@ public async Task IgnoreNavigationProperties()
x => x.IgnoreNavigationProperties(data)); x => x.IgnoreNavigationProperties(data));
} }
``` ```
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L71-L94' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorenavigationproperties' title='Start of snippet'>anchor</a></sup> <sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L68-L91' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorenavigationproperties' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet --> <!-- endSnippet -->