-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathDocsPagesRenderTests.cs
More file actions
36 lines (32 loc) · 1003 Bytes
/
DocsPagesRenderTests.cs
File metadata and controls
36 lines (32 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using AwesomeAssertions;
using Bunit;
using Microsoft.AspNetCore.Components;
using MudExtensions.Docs.Pages;
using NUnit.Framework;
using System.Reflection;
namespace MudExtensions.UnitTests.Components;
[TestFixture]
public class DocsPagesRenderTests : BunitTest
{
public static IEnumerable<Type> DocsPages()
{
return typeof(ApiPage).Assembly
.GetTypes()
.Where(t =>
t.IsClass &&
!t.IsAbstract &&
typeof(IComponent).IsAssignableFrom(t) &&
t.Namespace?.StartsWith("MudExtensions.Docs.Pages") == true &&
t.GetCustomAttribute<RouteAttribute>() != null);
}
[TestCaseSource(nameof(DocsPages))]
public void All_Docs_Pages_Should_Render(Type pageType)
{
var cut = Context.Render(builder =>
{
builder.OpenComponent(0, pageType);
builder.CloseComponent();
});
cut.Markup.Should().NotBeNullOrWhiteSpace();
}
}