File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
6+ using Microsoft . JSInterop ;
7+ using UnitTest . Mock ;
8+
69namespace UnitTest . Services ;
710
811public class VideoDeviceTest : BootstrapBlazorTestBase
@@ -27,7 +30,7 @@ public async Task GetDevices_Ok()
2730 public async Task Open_Ok ( )
2831 {
2932 Context . JSInterop . Setup < string ? > ( "getPreviewUrl" ) . SetResult ( "blob:https://test-preview" ) ;
30- Context . JSInterop . Setup < Stream ? > ( "getPreviewData" ) . SetResult ( new MemoryStream ( [ 0x01 , 0x02 ] ) ) ;
33+ Context . JSInterop . Setup < IJSStreamReference ? > ( "getPreviewData" ) . SetResult ( new MockJSStreamReference ( ) ) ;
3134 Context . JSInterop . Setup < bool > ( "open" , _ => true ) . SetResult ( true ) ;
3235 Context . JSInterop . Setup < bool > ( "close" , _ => true ) . SetResult ( true ) ;
3336 Context . JSInterop . Setup < bool > ( "apply" , _ => true ) . SetResult ( true ) ;
@@ -62,6 +65,6 @@ public async Task Open_Ok()
6265
6366 var data = await service . GetPreviewData ( ) ;
6467 Assert . NotNull ( data ) ;
65- Assert . Equal ( 2 , data . Length ) ;
68+ Assert . Equal ( 4 , data . Length ) ;
6669 }
6770}
You can’t perform that action at this time.
0 commit comments