From 86ab7ece565810161f669fe296090bba8d49a4ae Mon Sep 17 00:00:00 2001 From: Jimmy Bogard Date: Thu, 23 Feb 2023 09:44:17 -0600 Subject: [PATCH] Adding test to cover enumerables --- .../MicrosoftExtensionsDI/TypeResolutionTests.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs b/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs index ab47fe22..324fa519 100644 --- a/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs +++ b/test/MediatR.Tests/MicrosoftExtensionsDI/TypeResolutionTests.cs @@ -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; @@ -56,6 +58,12 @@ public void ShouldResolveNotificationHandlers() _provider.GetServices>().Count().ShouldBe(3); } + [Fact] + public void ShouldNotThrowWithMissingEnumerables() + { + Should.NotThrow(() => _provider.GetRequiredService>>()); + } + [Fact] public void ShouldResolveFirstDuplicateHandler() {