Skip to content

Commit 7c231a6

Browse files
authored
Merge pull request #7 from ManticSic/rename-class
Rename AppDomainAdapter to AssemblyProvider to match purpose
2 parents c641337 + c74a649 commit 7c231a6

6 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/UnityContainerAttributeRegistration/Populator/Populator.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using Unity;
66

7-
using UnityContainerAttributeRegistration.Adapter;
7+
using UnityContainerAttributeRegistration.Provider;
88

99

1010
namespace UnityContainerAttributeRegistration.Populator
@@ -14,15 +14,15 @@ namespace UnityContainerAttributeRegistration.Populator
1414
/// </summary>
1515
internal abstract class Populator : IPopulator
1616
{
17-
private readonly IAppDomainAdapter appDomain;
17+
private readonly IAssemblyProvider assemblyProvider;
1818

1919
/// <summary>
2020
/// ctor
2121
/// </summary>
22-
/// <param name="appDomain">Used <see cref="IAppDomainAdapter" /> for searching for candidates.</param>
23-
protected Populator(IAppDomainAdapter appDomain)
22+
/// <param name="assemblyProvider">Used <see cref="IAssemblyProvider" /> for searching for candidates.</param>
23+
protected Populator(IAssemblyProvider assemblyProvider)
2424
{
25-
this.appDomain = appDomain;
25+
this.assemblyProvider = assemblyProvider;
2626
}
2727

2828
/// <inheritdoc cref="IPopulator.Populate" />
@@ -33,10 +33,10 @@ protected Populator(IAppDomainAdapter appDomain)
3333
/// </summary>
3434
/// <param name="typeDefined">Using inheritance or not.</param>
3535
/// <typeparam name="TAttribute"><see cref="System.Attribute" /> used by searched <see cref="Type" />s.</typeparam>
36-
/// <returns>List of all <see cref="Type" />s in an <see cref="IAppDomainAdapter" /> using <typeparamref name="TAttribute" />.</returns>
36+
/// <returns>List of all <see cref="Type" />s in an <see cref="IAssemblyProvider" /> using <typeparamref name="TAttribute" />.</returns>
3737
protected IEnumerable<Type> GetTypesWith<TAttribute>(TypeDefined typeDefined) where TAttribute : System.Attribute
3838
{
39-
return appDomain.GetAssemblies()
39+
return assemblyProvider.GetAssemblies()
4040
.SelectMany(assembly => assembly.GetTypes())
4141
.Where(type => type.IsDefined(typeof(TAttribute), typeDefined == TypeDefined.Inherit))
4242
;

src/UnityContainerAttributeRegistration/Populator/TypePopulator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
using Unity;
99
using Unity.Lifetime;
1010

11-
using UnityContainerAttributeRegistration.Adapter;
1211
using UnityContainerAttributeRegistration.Attribute;
1312
using UnityContainerAttributeRegistration.Exention;
13+
using UnityContainerAttributeRegistration.Provider;
1414

1515

1616
namespace UnityContainerAttributeRegistration.Populator
@@ -23,10 +23,10 @@ internal class TypePopulator : Populator
2323
/// <summary>
2424
/// ctor
2525
/// </summary>
26-
/// <param name="appDomain">
27-
/// Used <see cref="IAppDomainAdapter" /> to find all candidates using <see cref="RegisterTypeAttribute" />
26+
/// <param name="assemblyProvider">
27+
/// Used <see cref="IAssemblyProvider" /> to find all candidates using <see cref="RegisterTypeAttribute" />
2828
/// </param>
29-
public TypePopulator(IAppDomainAdapter appDomain) : base(appDomain)
29+
public TypePopulator(IAssemblyProvider assemblyProvider) : base(assemblyProvider)
3030
{
3131
}
3232

src/UnityContainerAttributeRegistration/Adapter/AppDomainAdapter.cs renamed to src/UnityContainerAttributeRegistration/Provider/AssemblyProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
using System.Reflection;
44

55

6-
namespace UnityContainerAttributeRegistration.Adapter
6+
namespace UnityContainerAttributeRegistration.Provider
77
{
8-
/// <inheritdoc cref="IAppDomainAdapter" />
9-
internal class AppDomainAdapter : IAppDomainAdapter
8+
/// <inheritdoc cref="IAssemblyProvider" />
9+
internal class AssemblyProvider : IAssemblyProvider
1010
{
11-
/// <inheritdoc cref="IAppDomainAdapter.GetAssemblies" />
11+
/// <inheritdoc cref="IAssemblyProvider.GetAssemblies" />
1212
public IList<Assembly> GetAssemblies()
1313
{
1414
return AppDomain.CurrentDomain.GetAssemblies();

src/UnityContainerAttributeRegistration/Adapter/IAppDomainAdapter.cs renamed to src/UnityContainerAttributeRegistration/Provider/IAssemblyProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
using System.Reflection;
33

44

5-
namespace UnityContainerAttributeRegistration.Adapter
5+
namespace UnityContainerAttributeRegistration.Provider
66
{
77
/// <summary>
88
/// Wrapper to provide <see cref="IList{T}" /> instead of using <see cref="System.AppDomain" />.
99
/// </summary>
10-
public interface IAppDomainAdapter
10+
public interface IAssemblyProvider
1111
{
1212
/// <summary>
1313
/// Provide <see cref="Assembly" />s of an AppDomain.

src/UnityContainerAttributeRegistration/UnityContainerPopulator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
using Unity;
44

5-
using UnityContainerAttributeRegistration.Adapter;
65
using UnityContainerAttributeRegistration.Populator;
6+
using UnityContainerAttributeRegistration.Provider;
77

88

99
namespace UnityContainerAttributeRegistration
@@ -13,21 +13,21 @@ namespace UnityContainerAttributeRegistration
1313
/// </summary>
1414
public sealed class UnityContainerPopulator
1515
{
16-
private readonly IAppDomainAdapter appDomain;
16+
private readonly IAssemblyProvider appDomain;
1717
private readonly IPopulator TypePopulator;
1818

1919
/// <summary>
2020
/// Use <see cref="System.AppDomain.CurrentDomain" /> to populate an <see cref="Unity.IUnityContainer" />
2121
/// </summary>
22-
public UnityContainerPopulator() : this(new AppDomainAdapter())
22+
public UnityContainerPopulator() : this(new AssemblyProvider())
2323
{
2424
}
2525

2626
/// <summary>
2727
/// Use <paramref name="appDomain" /> to populate an <see cref="Unity.IUnityContainer" />
2828
/// </summary>
29-
/// <param name="appDomain">Custom <see cref="UnityContainerAttributeRegistration.Adapter.IAppDomainAdapter" /></param>
30-
public UnityContainerPopulator([NotNull] IAppDomainAdapter appDomain)
29+
/// <param name="appDomain">Custom <see cref="IAssemblyProvider" /></param>
30+
public UnityContainerPopulator([NotNull] IAssemblyProvider appDomain)
3131
{
3232
this.appDomain = appDomain;
3333

src/UnityContainerAttributeRegistrationTest/Helper/Scope.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
using Moq;
77

8-
using UnityContainerAttributeRegistration.Adapter;
8+
using UnityContainerAttributeRegistration.Provider;
99

1010

1111
namespace UnityContainerAttributeRegistrationTest.Helper
1212
{
1313
internal class Scope
1414
{
1515
private readonly Mock<Assembly> assemblyMock;
16-
private readonly Mock<IAppDomainAdapter> appDomainMock;
16+
private readonly Mock<IAssemblyProvider> appDomainMock;
1717

1818
private readonly IList<Type> typesInAssembly = new List<Type>();
1919

2020
public Scope()
2121
{
2222
assemblyMock = new Mock<Assembly>();
23-
appDomainMock = new Mock<IAppDomainAdapter>();
23+
appDomainMock = new Mock<IAssemblyProvider>();
2424
}
2525

2626
public Assembly Assembly
@@ -33,7 +33,7 @@ public void AddType(Type type)
3333
typesInAssembly.Add(type);
3434
}
3535

36-
public IAppDomainAdapter GetAppDomain()
36+
public IAssemblyProvider GetAppDomain()
3737
{
3838
assemblyMock.Setup(mock => mock.GetTypes())
3939
.Returns(typesInAssembly.ToArray());

0 commit comments

Comments
 (0)