Skip to content

Commit 1d1820c

Browse files
authored
Implement Connection tests (#175)
1 parent 3c00dfd commit 1d1820c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
using Xunit;
4+
5+
namespace PuppeteerSharp.Tests.Frame
6+
{
7+
[Collection("PuppeteerLoaderFixture collection")]
8+
public class ConnectionTests : PuppeteerPageBaseTest
9+
{
10+
[Fact]
11+
public async Task ShouldThrowNiceErrors()
12+
{
13+
var exception = await Assert.ThrowsAsync<MessageException>(async () =>
14+
{
15+
await TheSourceOfTheProblems();
16+
});
17+
Assert.Contains("TheSourceOfTheProblems", exception.StackTrace);
18+
Assert.Contains("ThisCommand.DoesNotExist", exception.Message);
19+
}
20+
21+
private async Task TheSourceOfTheProblems()
22+
{
23+
await Page.Client.SendAsync("ThisCommand.DoesNotExist");
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)