Skip to content

Commit d4cf9f4

Browse files
committed
fix nesting
1 parent 267d083 commit d4cf9f4

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

readme.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Enable VerifyEntityFramework once at assembly load time:
2525
```cs
2626
VerifyEntityFramework.Enable();
2727
```
28-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L473-L477' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablecore' title='Start of snippet'>anchor</a></sup>
28+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L476-L480' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablecore' title='Start of snippet'>anchor</a></sup>
2929
<!-- endSnippet -->
3030

3131

@@ -57,7 +57,7 @@ builder.UseSqlServer(connection);
5757
builder.EnableRecording();
5858
var data = new SampleDbContext(builder.Options);
5959
```
60-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L235-L242' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablerecording' title='Start of snippet'>anchor</a></sup>
60+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L238-L245' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablerecording' title='Start of snippet'>anchor</a></sup>
6161
<!-- endSnippet -->
6262

6363
`EnableRecording` should only be called in the test context.
@@ -85,7 +85,7 @@ await data.Companies
8585

8686
await Verify(data.Companies.Count());
8787
```
88-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L315-L332' title='Snippet source file'>snippet source</a> | <a href='#snippet-recording' title='Start of snippet'>anchor</a></sup>
88+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L318-L335' title='Snippet source file'>snippet source</a> | <a href='#snippet-recording' title='Start of snippet'>anchor</a></sup>
8989
<!-- endSnippet -->
9090

9191
Will result in the following verified file:
@@ -142,7 +142,7 @@ await Verify(new
142142
sql = entries
143143
});
144144
```
145-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L439-L462' title='Snippet source file'>snippet source</a> | <a href='#snippet-recordingspecific' title='Start of snippet'>anchor</a></sup>
145+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L442-L465' title='Snippet source file'>snippet source</a> | <a href='#snippet-recordingspecific' title='Start of snippet'>anchor</a></sup>
146146
<!-- endSnippet -->
147147

148148

@@ -173,7 +173,7 @@ await data2.Companies
173173

174174
await Verify(data2.Companies.Count());
175175
```
176-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L284-L306' title='Snippet source file'>snippet source</a> | <a href='#snippet-multidbcontexts' title='Start of snippet'>anchor</a></sup>
176+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L287-L309' title='Snippet source file'>snippet source</a> | <a href='#snippet-multidbcontexts' title='Start of snippet'>anchor</a></sup>
177177
<!-- endSnippet -->
178178

179179
<!-- snippet: CoreTests.MultiDbContexts.verified.txt -->
@@ -364,7 +364,7 @@ var queryable = data.Companies
364364
.Where(x => x.Content == "value");
365365
await Verify(queryable);
366366
```
367-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L214-L220' title='Snippet source file'>snippet source</a> | <a href='#snippet-queryable' title='Start of snippet'>anchor</a></sup>
367+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L217-L223' title='Snippet source file'>snippet source</a> | <a href='#snippet-queryable' title='Start of snippet'>anchor</a></sup>
368368
<!-- endSnippet -->
369369

370370
Will result in the following verified file:
@@ -412,7 +412,7 @@ await Verify(data.AllData())
412412
serializer =>
413413
serializer.TypeNameHandling = TypeNameHandling.Objects));
414414
```
415-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L196-L205' title='Snippet source file'>snippet source</a> | <a href='#snippet-alldata' title='Start of snippet'>anchor</a></sup>
415+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L199-L208' title='Snippet source file'>snippet source</a> | <a href='#snippet-alldata' title='Start of snippet'>anchor</a></sup>
416416
<!-- endSnippet -->
417417

418418
Will result in the following verified file with all data in the database:
@@ -516,7 +516,7 @@ To be able to use [WebApplicationFactory](https://docs.microsoft.com/en-us/dotne
516516
.Options);
517517
});
518518
```
519-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L397-L408' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablerecordingwithidentifier' title='Start of snippet'>anchor</a></sup>
519+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L400-L411' title='Snippet source file'>snippet source</a> | <a href='#snippet-enablerecordingwithidentifier' title='Start of snippet'>anchor</a></sup>
520520
<!-- endSnippet -->
521521

522522
Then use the same identifier for recording:
@@ -532,7 +532,7 @@ var companies = await httpClient.GetFromJsonAsync<Company[]>("/companies");
532532

533533
var entries = EfRecording.FinishRecording(testName);
534534
```
535-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L364-L374' title='Snippet source file'>snippet source</a> | <a href='#snippet-recordwithidentifier' title='Start of snippet'>anchor</a></sup>
535+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L367-L377' title='Snippet source file'>snippet source</a> | <a href='#snippet-recordwithidentifier' title='Start of snippet'>anchor</a></sup>
536536
<!-- endSnippet -->
537537

538538
The results will not be automatically included in verified file so it will have to be verified manually:
@@ -546,7 +546,7 @@ await Verify(new
546546
sql = entries
547547
});
548548
```
549-
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L376-L384' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyrecordedcommandswithidentifier' title='Start of snippet'>anchor</a></sup>
549+
<sup><a href='/src/Verify.EntityFramework.Tests/CoreTests.cs#L379-L387' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyrecordedcommandswithidentifier' title='Start of snippet'>anchor</a></sup>
550550
<!-- endSnippet -->
551551

552552

src/Verify.EntityFramework.Tests/CoreTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ class TargetWithFactoryInterface
162162

163163
[Test]
164164
public Task ShouldIgnoreDbContext() =>
165-
Verify(new SampleDbContext(new DbContextOptions<SampleDbContext>()));
165+
Verify(new
166+
{
167+
Factory = new SampleDbContext(new DbContextOptions<SampleDbContext>())
168+
});
166169

167170
class MyDbContextFactory : IDbContextFactory<SampleDbContext>
168171
{

0 commit comments

Comments
 (0)