mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-03-12 04:35:27 -07:00
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using Microsoft.Extensions.Logging;
|
|
using Microsoft.Extensions.Logging.Abstractions;
|
|
using Moq.AutoMock;
|
|
using NUnit.Framework;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Ombi.Notifications.Tests
|
|
{
|
|
[TestFixture]
|
|
public class NotificationServiceTests
|
|
{
|
|
|
|
private NotitficationServiceTestFacade _subject;
|
|
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
var mocker = new AutoMocker();
|
|
mocker.Use(NullLogger.Instance);
|
|
_subject = mocker.CreateInstance<NotitficationServiceTestFacade>();
|
|
}
|
|
|
|
[Test]
|
|
public void PopulateAgentsTests()
|
|
{
|
|
Assert.That(_subject.Agents, Has.Count.EqualTo(12));
|
|
Assert.That(_subject.Agents.DistinctBy(x => x.NotificationName).ToList(), Has.Count.EqualTo(12));
|
|
}
|
|
}
|
|
|
|
|
|
public class NotitficationServiceTestFacade : NotificationService
|
|
{
|
|
public NotitficationServiceTestFacade(IServiceProvider provider, ILogger<NotificationService> log) : base(provider, log)
|
|
{
|
|
}
|
|
|
|
public List<INotification> Agents => base.NotificationAgents;
|
|
}
|
|
}
|