Skip to content

Commit

Permalink
extensions package for a named client
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasjurasek committed Jan 19, 2021
1 parent c1219b7 commit 949a3d4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void AddDeliveryNamedClient_WithTypeProvider_GetTypeProvider()
}

[Fact]
public void AddDeliveryNamedClient_WithNamedAndNonamedTypeProvider_GetNamedTypePovider()
public void AddDeliveryNamedClient_WithNamedAndNoNamedTypeProvider_GetNamedTypePovider()
{
A.CallTo(() => _customServiceProvider.GetService<ITypeProvider>("named"))
.Returns(new FakeNamedTypeProvider());
Expand Down Expand Up @@ -199,7 +199,5 @@ public Type GetType(string contentType)
throw new NotImplementedException();
}
}


}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Kentico.Kontent.Delivery.Extensions.DependencyInjection
{
/// <summary>
/// An enum represents a type of custom provider.
/// An enum represents a type of custom service provider.
/// </summary>
public enum CustomServiceProviderType
{
Expand All @@ -11,7 +11,7 @@ public enum CustomServiceProviderType
None = 0,

/// <summary>
/// An autofac service provider.
/// The autofac service provider.
/// </summary>
Autofac = 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface ICustomServiceProvider
/// </summary>
/// <typeparam name="T">A type of service.</typeparam>
/// <param name="name">A name of service.</param>
/// <returns>The component instance that provides the service or returns a null.</returns>
/// <returns>The component instance that provides the service otherwise returns a null.</returns>
T GetService<T>(string name);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Autofac;
using Autofac.Core.Registration;
using Kentico.Kontent.Delivery.Abstractions;
using Kentico.Kontent.Delivery.Abstractions;
using Kentico.Kontent.Delivery.Caching;
using Kentico.Kontent.Delivery.Caching.Factories;
using Microsoft.Extensions.Caching.Distributed;
Expand Down Expand Up @@ -83,6 +81,7 @@ private T GetNamedServiceOrDefault<T>(string name)
{
service = _serviceProvider.GetService<T>();
}

return service;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private T GetNamedServiceOrDefault<T>(string name)
{
service = GetService<T>();
}

return service;
}

Expand Down

0 comments on commit 949a3d4

Please sign in to comment.