1111using Microsoft . VisualStudio . Text . Editor ;
1212using NSubstitute ;
1313using NUnit . Framework ;
14+ using GitHub . InlineReviews . Margins ;
1415
1516namespace GitHub . InlineReviews . UnitTests . Tags
1617{
@@ -298,16 +299,17 @@ public void ShouldNotReturnAddNewCommentTagForDeletedLineOnRhs()
298299 var span = CreateSpan ( 13 ) ;
299300 var firstPass = target . GetTags ( span ) ;
300301 var result = target . GetTags ( span ) . ToList ( ) ;
301- Assert . That ( result , Is . Empty ) ;
302+ Assert . That ( result , Is . Empty ) ;
302303 }
303304
304- [ Test ]
305- public void ShouldRaiseTagsChangedOnFileLinesChanged ( )
305+ [ TestCase ( true , true ) ]
306+ [ TestCase ( false , false ) ]
307+ public void ShouldRaiseTagsChangedOnFileLinesChanged ( bool inlineCommentMarginVisible , bool expectRaised )
306308 {
307309 var file = CreateSessionFile ( ) ;
308310 var manager = CreateSessionManager ( file ) ;
309311 var target = new InlineCommentTagger (
310- Substitute . For < ITextView > ( ) ,
312+ CreateTextView ( inlineCommentMarginVisible ) ,
311313 CreateBuffer ( ) ,
312314 manager ) ;
313315
@@ -322,7 +324,7 @@ public void ShouldRaiseTagsChangedOnFileLinesChanged()
322324 Tuple . Create ( 14 , DiffSide . Right ) ,
323325 } ) ;
324326
325- Assert . True ( raised ) ;
327+ Assert . That ( raised , Is . EqualTo ( expectRaised ) ) ;
326328 }
327329
328330 [ Test ]
@@ -349,6 +351,13 @@ public void ShouldNotRaiseTagsChangedOnLeftHandSideLinesChanged()
349351 Assert . False ( raised ) ;
350352 }
351353
354+ static ITextView CreateTextView ( bool inlineCommentMarginVisible = true )
355+ {
356+ var textView = Substitute . For < ITextView > ( ) ;
357+ textView . Options . GetOptionValue < bool > ( InlineCommentMarginVisible . OptionName ) . Returns ( inlineCommentMarginVisible ) ;
358+ return textView ;
359+ }
360+
352361 static IPullRequestSessionFile CreateSessionFile ( )
353362 {
354363 var diffChunk = new DiffChunk
0 commit comments