Files
Heimdall/tests/Heimdall.Web.Tests/PlaceholderTest.cs
T

35 lines
1.1 KiB
C#
Raw Normal View History

using Microsoft.Extensions.DependencyInjection;
using MudBlazor;
using MudBlazor.Services;
namespace Heimdall.Web.Tests;
public class MudBlazorServicesTests
{
[Fact]
public void AddMudServices_ConfiguresServiceCollection()
{
var services = new ServiceCollection();
services.AddMudServices(config =>
{
config.SnackbarConfiguration.PositionClass = "mud-alert-center-top";
config.SnackbarConfiguration.PreventDuplicates = true;
config.SnackbarConfiguration.VisibleStateDuration = 4000;
});
// Verify services were added by checking that ISnackbar is registered
var descriptor = services.FirstOrDefault(s => s.ServiceType == typeof(ISnackbar));
Assert.NotNull(descriptor);
Assert.Equal(ServiceLifetime.Scoped, descriptor.Lifetime);
}
[Fact]
public void AddMudServices_RegistersDialogService()
{
var services = new ServiceCollection();
services.AddMudServices();
var descriptor = services.FirstOrDefault(s => s.ServiceType == typeof(IDialogService));
Assert.NotNull(descriptor);
}
}