@@ -385,9 +385,26 @@ public async Task TestRestoreWord()
385385
386386 var result = await _wordController . RestoreWord ( ProjId , word . Id ) ;
387387
388- Assert . That ( result , Is . InstanceOf < OkResult > ( ) ) ;
388+ Assert . That ( result , Is . InstanceOf < OkObjectResult > ( ) ) ;
389+ Assert . That ( ( ( OkObjectResult ) result ) . Value , Is . True ) ;
390+ Assert . That ( await _wordRepo . GetAllWords ( ProjId ) , Does . Contain ( word ) . UsingPropertiesComparer ( ) ) ;
391+ Assert . That ( await _wordRepo . GetAllFrontier ( ProjId ) , Does . Contain ( word ) . UsingPropertiesComparer ( ) ) ;
392+ }
393+
394+ [ Test ]
395+ public async Task TestRestoreWordAlreadyInFrontier ( )
396+ {
397+ var word = await _wordRepo . Create ( Util . RandomWord ( ProjId ) ) ;
398+
389399 Assert . That ( await _wordRepo . GetAllWords ( ProjId ) , Does . Contain ( word ) . UsingPropertiesComparer ( ) ) ;
390400 Assert . That ( await _wordRepo . GetAllFrontier ( ProjId ) , Does . Contain ( word ) . UsingPropertiesComparer ( ) ) ;
401+ var frontierCount = await _wordRepo . GetFrontierCount ( ProjId ) ;
402+
403+ var result = await _wordController . RestoreWord ( ProjId , word . Id ) ;
404+
405+ Assert . That ( result , Is . InstanceOf < OkObjectResult > ( ) ) ;
406+ Assert . That ( ( ( OkObjectResult ) result ) . Value , Is . False ) ;
407+ Assert . That ( await _wordRepo . GetFrontierCount ( ProjId ) , Is . EqualTo ( frontierCount ) ) ;
391408 }
392409
393410 [ Test ]
@@ -404,20 +421,7 @@ public async Task TestRestoreWordNoPermission()
404421 public async Task TestRestoreWordMissingWord ( )
405422 {
406423 var wordResult = await _wordController . RestoreWord ( ProjId , MissingId ) ;
407- Assert . That ( wordResult , Is . InstanceOf < BadRequestResult > ( ) ) ;
408- }
409-
410- [ Test ]
411- public async Task TestRestoreWordAlreadyInFrontier ( )
412- {
413- var word = await _wordRepo . Create ( Util . RandomWord ( ProjId ) ) ;
414-
415- Assert . That ( await _wordRepo . GetAllWords ( ProjId ) , Does . Contain ( word ) . UsingPropertiesComparer ( ) ) ;
416- Assert . That ( await _wordRepo . GetAllFrontier ( ProjId ) , Does . Contain ( word ) . UsingPropertiesComparer ( ) ) ;
417-
418- var result = await _wordController . RestoreWord ( ProjId , word . Id ) ;
419-
420- Assert . That ( result , Is . InstanceOf < BadRequestResult > ( ) ) ;
424+ Assert . That ( wordResult , Is . InstanceOf < NotFoundResult > ( ) ) ;
421425 }
422426
423427 [ Test ]
0 commit comments