Skip to content

Commit 5ec815d

Browse files
committed
test: 更新单元测试
1 parent b701625 commit 5ec815d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/UnitTest/Services/VideoDeviceTest.cs

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

3132
var service = Context.Services.GetRequiredService<IVideoDevice>();
3233
var options = new MediaTrackConstraints()
@@ -40,7 +41,8 @@ public async Task Open_Ok()
4041
var open = await service.Open(options);
4142
Assert.True(open);
4243

43-
await service.Close(".bb-video");
44+
var close = await service.Close(".bb-video");
45+
Assert.True(close);
4446

4547
Assert.Equal("test-device-id", options.DeviceId);
4648
Assert.Equal("user", options.FacingMode);

0 commit comments

Comments
 (0)