-
-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(notifications): 🐛 This is a fix for some of the duplicate notific…
…ation issues #3825
- Loading branch information
Showing
4 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters