Skip to content

Commit 6113c26

Browse files
committed
.
1 parent 290e069 commit 6113c26

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public async Task Modified()
139139

140140
await using (var context = new SampleDbContext(options))
141141
{
142-
context.Companies.Add(new Company {Content = "before"});
142+
context.Add(new Company {Content = "before"});
143143
context.SaveChanges();
144144
}
145145

@@ -190,7 +190,7 @@ public async Task Queryable()
190190
await Verify(queryable);
191191
}
192192
```
193-
<sup><a href='/src/Tests/Tests.cs#L65-L74' title='File snippet `queryable` was extracted from'>snippet source</a> | <a href='#snippet-queryable' title='Navigate to start of snippet `queryable`'>anchor</a></sup>
193+
<sup><a href='/src/Tests/Tests.cs#L86-L95' title='File snippet `queryable` was extracted from'>snippet source</a> | <a href='#snippet-queryable' title='Navigate to start of snippet `queryable`'>anchor</a></sup>
194194
<!-- endsnippet -->
195195

196196
Will result in the following verified file:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
Modified: {
3+
Employee: {
4+
Id: 0,
5+
Content: {
6+
Original: 'before',
7+
Current: 'after'
8+
}
9+
}
10+
}
11+
}

src/Tests/Tests.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task Modified()
5050

5151
await using (var context = new SampleDbContext(options))
5252
{
53-
context.Companies.Add(new Company {Content = "before"});
53+
context.Add(new Company {Content = "before"});
5454
context.SaveChanges();
5555
}
5656

@@ -61,6 +61,27 @@ public async Task Modified()
6161
}
6262
}
6363
#endregion
64+
[Fact]
65+
public async Task SomePropsModified()
66+
{
67+
var options = DbContextOptions();
68+
69+
await using (var context = new SampleDbContext(options))
70+
{
71+
context.Add(new Employee
72+
{
73+
Content = "before",
74+
Age = 10
75+
});
76+
context.SaveChanges();
77+
}
78+
79+
await using (var context = new SampleDbContext(options))
80+
{
81+
context.Employees.Single().Content = "after";
82+
await Verify(context);
83+
}
84+
}
6485

6586
#region Queryable
6687
[Fact]

0 commit comments

Comments
 (0)