A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
1.1 KiB

using System;
using System.Reflection;
using Avalonia.Themes.Fluent;
using Avalonia.Themes.Simple;
using Avalonia.Themes.UnitTests.Utilities;
using Xunit;
namespace Avalonia.Themes.UnitTests;
[Trait("Category", "FluentTheme")]
public class FluentThemeClassTests() : ThemeClassTests(typeof(FluentTheme));
[Trait("Category", "SimpleTheme")]
public class SimpleThemeClassTests() : ThemeClassTests(typeof(SimpleTheme));
public abstract class ThemeClassTests(Type typeEntryPoint) : ThemeTestBase(typeEntryPoint)
{
[Fact]
public void Should_Have_ServiceProvider_Ctor()
{
var ctor = EntryPointClass.GetConstructor(
BindingFlags.Public | BindingFlags.Instance, [typeof(IServiceProvider)]);
Assert.NotNull(ctor);
}
[Fact]
public void Should_Be_Reachable_With_Ctor()
{
var theme = CallCtor();
Assert.NotNull(theme);
Assert.IsType(EntryPointClass, theme);
}
[Fact]
public void Should_Be_Reachable_With_Avares_Loader()
{
var theme = CallTryLoad($"{EntryPointClass.Name}.xaml");
Assert.NotNull(theme);
Assert.IsType(EntryPointClass, theme);
}
}