Skip to content

Commit 6b1b9b3

Browse files
committed
test: 更新单元测试
1 parent c450849 commit 6b1b9b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/UnitTest/Services/VideoDeviceTest.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public async Task GetDevices_Ok()
2626
public async Task Open_Ok()
2727
{
2828
Context.JSInterop.Setup<string?>("getPreviewUrl").SetResult("blob:https://test-preview");
29+
Context.JSInterop.Setup<bool>("open", _ => true).SetResult(true);
2930

3031
var service = Context.Services.GetRequiredService<IVideoDevice>();
3132
var options = new MediaTrackConstraints()
@@ -36,7 +37,9 @@ public async Task Open_Ok()
3637
Width = 480,
3738
VideoSelector = ".bb-video"
3839
};
39-
await service.Open(options);
40+
var open = await service.Open(options);
41+
Assert.True(open);
42+
4043
await service.Close(".bb-video");
4144

4245
Assert.Equal("test-device-id", options.DeviceId);

0 commit comments

Comments
 (0)