@@ -59,7 +59,7 @@ public void BeforeUpdate()
59
59
hookExecutor . BeforeUpdate ( todoList , ResourcePipeline . Patch ) ;
60
60
61
61
// assert
62
- todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IEntityHashSetDiff < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
62
+ todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IDiffableEntityHashSet < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
63
63
ownerResourceMock . Verify ( rd => rd . BeforeUpdateRelationship (
64
64
It . Is < HashSet < string > > ( ids => PersonIdCheck ( ids , personId ) ) ,
65
65
It . Is < IRelationshipsDictionary < Person > > ( rh => PersonCheck ( lastName , rh ) ) ,
@@ -93,7 +93,7 @@ public void BeforeUpdate_Deleting_Relationship()
93
93
hookExecutor . BeforeUpdate ( _todoList , ResourcePipeline . Patch ) ;
94
94
95
95
// assert
96
- todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IEntityHashSetDiff < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
96
+ todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IDiffableEntityHashSet < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
97
97
ownerResourceMock . Verify ( rd => rd . BeforeImplicitUpdateRelationship (
98
98
It . Is < IRelationshipsDictionary < Person > > ( rh => PersonCheck ( lastName + lastName , rh ) ) ,
99
99
ResourcePipeline . Patch ) ,
@@ -140,7 +140,7 @@ public void BeforeUpdate_Without_Child_Hook_Implemented()
140
140
hookExecutor . BeforeUpdate ( todoList , ResourcePipeline . Patch ) ;
141
141
142
142
// assert
143
- todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IEntityHashSetDiff < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
143
+ todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IDiffableEntityHashSet < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
144
144
todoResourceMock . Verify ( rd => rd . BeforeImplicitUpdateRelationship (
145
145
It . Is < IRelationshipsDictionary < TodoItem > > ( rh => TodoCheck ( rh , description + description ) ) ,
146
146
ResourcePipeline . Patch ) ,
@@ -161,7 +161,7 @@ public void BeforeUpdate_NoImplicit()
161
161
hookExecutor . BeforeUpdate ( todoList , ResourcePipeline . Patch ) ;
162
162
163
163
// assert
164
- todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IEntityHashSetDiff < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
164
+ todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IDiffableEntityHashSet < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
165
165
ownerResourceMock . Verify ( rd => rd . BeforeUpdateRelationship (
166
166
It . Is < HashSet < string > > ( ids => PersonIdCheck ( ids , personId ) ) ,
167
167
It . IsAny < IRelationshipsDictionary < Person > > ( ) ,
@@ -204,18 +204,18 @@ public void BeforeUpdate_NoImplicit_Without_Child_Hook_Implemented()
204
204
hookExecutor . BeforeUpdate ( todoList , ResourcePipeline . Patch ) ;
205
205
206
206
// assert
207
- todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IEntityHashSetDiff < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
207
+ todoResourceMock . Verify ( rd => rd . BeforeUpdate ( It . Is < IDiffableEntityHashSet < TodoItem > > ( ( diff ) => TodoCheckDiff ( diff , description ) ) , ResourcePipeline . Patch ) , Times . Once ( ) ) ;
208
208
VerifyNoOtherCalls ( todoResourceMock , ownerResourceMock ) ;
209
209
}
210
210
211
- private bool TodoCheckDiff ( IEntityHashSetDiff < TodoItem > diff , string checksum )
211
+ private bool TodoCheckDiff ( IDiffableEntityHashSet < TodoItem > entities , string checksum )
212
212
{
213
- var diffPair = diff . Single ( ) ;
213
+ var diffPair = entities . GetDiffs ( ) . Single ( ) ;
214
214
var dbCheck = diffPair . DatabaseValue . Description == checksum ;
215
215
var reqCheck = diffPair . Entity . Description == null ;
216
216
var diffPairCheck = ( dbCheck && reqCheck ) ;
217
217
218
- var updatedRelationship = diff . Entities . GetByRelationship < Person > ( ) . Single ( ) ;
218
+ var updatedRelationship = entities . GetByRelationship < Person > ( ) . Single ( ) ;
219
219
var diffcheck = updatedRelationship . Key . PublicRelationshipName == "one-to-one-person" ;
220
220
221
221
return ( dbCheck && reqCheck && diffcheck ) ;
0 commit comments