Skip to content

Commit

Permalink
Adding test to cover enumerables
Browse files Browse the repository at this point in the history
  • Loading branch information
jbogard committed Feb 23, 2023
1 parent f2cc711 commit 86ab7ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;

namespace MediatR.Extensions.Microsoft.DependencyInjection.Tests;

using System;
using System.Linq;
using System.Reflection;
using MediatR.Pipeline;
using Shouldly;
using Xunit;

Expand Down Expand Up @@ -56,6 +58,12 @@ public void ShouldResolveNotificationHandlers()
_provider.GetServices<INotificationHandler<Pinged>>().Count().ShouldBe(3);
}

[Fact]
public void ShouldNotThrowWithMissingEnumerables()
{
Should.NotThrow(() => _provider.GetRequiredService<IEnumerable<IRequestExceptionAction<int, Exception>>>());
}

[Fact]
public void ShouldResolveFirstDuplicateHandler()
{
Expand Down

0 comments on commit 86ab7ec

Please sign in to comment.