Skip to content

Commit 02db1ab

Browse files
committed
Added TitleTests
1 parent 2296336 commit 02db1ab

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Bunit;
2+
using FluentAssertions;
3+
using LinkDotNet.Blog.Web.Shared;
4+
using Xunit;
5+
6+
namespace LinkDotNet.Blog.UnitTests.Web.Shared
7+
{
8+
public class TitleTests
9+
{
10+
[Fact]
11+
public void ShouldSetTitle()
12+
{
13+
using var ctx = new TestContext();
14+
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
15+
16+
ctx.RenderComponent<Title>(c => c.Add(p => p.Value, "New Title"));
17+
18+
ctx.JSInterop.VerifyInvoke("setDocumentTitle").Arguments[0].Should().Be("New Title");
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)