File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,21 @@ public async Task CanAddTheSameCommitMultipleTimesVisSync()
2929 var entry = await DataModel . GetLatest < Word > ( entity1Id ) ;
3030 entry ! . Text . Should ( ) . Be ( "entity1.1" ) ;
3131 }
32+
33+ [ Fact ]
34+ public async Task InvalidCommitHashesResultInException ( )
35+ {
36+ // arrange
37+ var addedCommit = await WriteNextChange ( SetWord ( Guid . NewGuid ( ) , "word" ) ) ;
38+
39+ // act - break the hash
40+ addedCommit . SetParentHash ( "BBAADD" ) ;
41+ DbContext . SaveChanges ( ) ;
42+
43+ // act - add another commit to trigger validation
44+ Func < Task > act = async ( ) => await WriteNextChange ( SetWord ( Guid . NewGuid ( ) , "word" ) ) ;
45+
46+ // assert - validation detects the broken hash
47+ await act . Should ( ) . ThrowAsync < CommitValidationException > ( ) . WithMessage ( "*does not match expected hash*" ) ;
48+ }
3249}
You can’t perform that action at this time.
0 commit comments