diff --git a/Microsoft.Kiota.Http.HttpClientLibrary.Tests/KiotaClientFactoryTests.cs b/Microsoft.Kiota.Http.HttpClientLibrary.Tests/KiotaClientFactoryTests.cs index cead02d..5459348 100644 --- a/Microsoft.Kiota.Http.HttpClientLibrary.Tests/KiotaClientFactoryTests.cs +++ b/Microsoft.Kiota.Http.HttpClientLibrary.Tests/KiotaClientFactoryTests.cs @@ -1,9 +1,7 @@ -using System.Collections; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; -using Castle.Components.DictionaryAdapter.Xml; using Microsoft.Kiota.Http.HttpClientLibrary.Middleware; using Microsoft.Kiota.Http.HttpClientLibrary.Middleware.Options; using Microsoft.Kiota.Http.HttpClientLibrary.Tests.Mocks; @@ -112,21 +110,12 @@ public void CreateDefaultHandlersWithOptions() // Act - var handlers = KiotaClientFactory.CreateDefaultHandlers(new[] { retryHandlerOption }); - - RetryHandler retryHandler = default; - foreach(var handler in handlers) - { - if(handler is RetryHandler retryFromDefault) - { - retryHandler = retryFromDefault; - break; - } - } + var handlers = KiotaClientFactory.CreateDefaultHandlers([retryHandlerOption]); + var retryHandler = handlers.OfType().FirstOrDefault(); // Assert Assert.NotNull(retryHandler); - Assert.NotNull(retryHandler.RetryOption); + Assert.Equal(retryHandlerOption, retryHandler.RetryOption); } [Fact]