@@ -425,18 +425,86 @@ public async Task Pound_i_nuget_displays_list_of_added_sources(Language language
425425
426426 using var events = kernel . KernelEvents . ToSubscribedList ( ) ;
427427
428- await kernel . SubmitCodeAsync ( @"#i ""nuget:https://completelyFakerestoreSource""" ) ;
428+ await kernel . SubmitCodeAsync ( @"
429+ #i ""nuget:https://completelyFakerestoreSource1""
430+ #i ""nuget:https://completelyFakerestoreSource2""
431+ " ) ;
432+ events . OfType < DisplayEvent > ( ) . Select ( e => e . GetType ( ) ) . Should ( ) . ContainInOrder ( typeof ( DisplayedValueProduced ) , typeof ( DisplayedValueUpdated ) ) ;
433+ }
429434
435+ [ Theory ]
436+ [ InlineData ( Language . CSharp ) ]
437+ [ InlineData ( Language . FSharp ) ]
438+ public async Task Pound_i_nuget_with_multi_submissions_combines_the_Text_Produced ( Language language )
439+ {
440+ var kernel = CreateKernel ( language ) ;
441+
442+ await kernel . SubmitCodeAsync ( @"
443+ #i ""nuget:https://completelyFakerestoreSourceCommand1.1""
444+ #i ""nuget:https://completelyFakerestoreSourceCommand1.2""
445+ " ) ;
446+
447+ var result = await kernel . SubmitCodeAsync ( @"
448+ #i ""nuget:https://completelyFakerestoreSourceCommand2.1""
449+ " ) ;
450+
451+ var expectedList = new [ ]
452+ {
453+ "https://completelyFakerestoreSourceCommand1.1" ,
454+ "https://completelyFakerestoreSourceCommand1.2" ,
455+ "https://completelyFakerestoreSourceCommand2.1"
456+ } ;
457+
458+ using var events = result . KernelEvents . ToSubscribedList ( ) ;
459+
460+ // For the DisplayedValueUpdated events strip out the restore sources
461+ // Verify that they match the expected values
430462 events . Should ( )
431- . ContainSingle < DisplayedValueUpdated > ( )
432- . Which
433- . FormattedValues
463+ . ContainSingle < DisplayedValueProduced > ( )
464+ . Which . FormattedValues
434465 . Should ( )
435- . ContainSingle ( v => v . MimeType == "text/html" )
436- . Which
437- . Value
466+ . ContainSingle ( e => e . MimeType == HtmlFormatter . MimeType )
467+ . Which . Value
468+ . Should ( )
469+ . ContainAll ( expectedList ) ;
470+ }
471+
472+ [ Theory ]
473+ [ InlineData ( Language . CSharp ) ]
474+ [ InlineData ( Language . FSharp ) ]
475+ public async Task Pound_i_nuget_with_multi_submissions_combines_the_Text_Updates ( Language language )
476+ {
477+ var kernel = CreateKernel ( language ) ;
478+
479+ await kernel . SubmitCodeAsync ( @"
480+ #i ""nuget:https://completelyFakerestoreSourceCommand1.1""
481+ #i ""nuget:https://completelyFakerestoreSourceCommand1.2""
482+ " ) ;
483+
484+ var result = await kernel . SubmitCodeAsync ( @"
485+ #i ""nuget:https://completelyFakerestoreSourceCommand2.1""
486+ #i ""nuget:https://completelyFakerestoreSourceCommand2.2""
487+ " ) ;
488+
489+ var expectedList = new [ ]
490+ {
491+ "https://completelyFakerestoreSourceCommand1.1" ,
492+ "https://completelyFakerestoreSourceCommand1.2" ,
493+ "https://completelyFakerestoreSourceCommand2.1" ,
494+ "https://completelyFakerestoreSourceCommand2.2"
495+ } ;
496+
497+ using var events = result . KernelEvents . ToSubscribedList ( ) ;
498+
499+ // For the DisplayedValueUpdated events strip out the restore sources
500+ // Verify that they match the expected values
501+ events . OfType < DisplayedValueUpdated > ( )
502+ . Last ( ) . FormattedValues
503+ . Should ( )
504+ . ContainSingle ( e => e . MimeType == HtmlFormatter . MimeType )
505+ . Which . Value
438506 . Should ( )
439- . ContainAll ( "Restore sources" , "https://completelyFakerestoreSource" ) ;
507+ . ContainAll ( expectedList ) ;
440508 }
441509
442510 [ Theory ]
0 commit comments