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.
Ombi/src/Ombi.Notifications.Tests/NotificationServiceTests.cs

43 lines
1.1 KiB

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;
}
}