Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public constructor to internal classes which are instantiated via IoC #19

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/BBT.StructureTools.Tests/TestTools/TestIocContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ public static class TestIocContainer
/// </summary>
public static IKernel Initialize()
{
var settings = new NinjectSettings
{
InjectNonPublic = true,
};
var settings = new NinjectSettings();

var kernel = new StandardKernel(settings);

Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Compare/CompareHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
/// <inheritdoc/>
internal class CompareHelper : ICompareHelper
{
/// <summary>
/// Initializes a new instance of the <see cref="CompareHelper" /> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public CompareHelper()
{
}

/// <inheritdoc/>
public void DoComparePostProcessing<T, TIntention>(
T candidate1Nullable,
Expand Down
6 changes: 5 additions & 1 deletion src/BBT.StructureTools/Compare/Comparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ internal class Comparer<T, TIntention> : IComparer<T, TIntention>
/// <summary>
/// Initializes a new instance of the <see cref="Comparer{TModelToCompare,TCompareIntention}" /> class.
/// </summary>
internal Comparer(
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public Comparer(
ICompareRegistrations<T, TIntention> compareRegistrations,
IEqualityComparerHelperRegistrationFactory factory,
ICompareHelper compareHelper)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ internal class EqualityComparerHelperOperations<TModel> : IEqualityComparerHelpe
/// <summary>
/// Initializes a new instance of the <see cref="EqualityComparerHelperOperations{TModel}"/> class.
/// </summary>
internal EqualityComparerHelperOperations(IEnumerable<IEqualityComparerHelperStrategy<TModel>> registeredStrategies)
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public EqualityComparerHelperOperations(IEnumerable<IEqualityComparerHelperStrategy<TModel>> registeredStrategies)
{
registeredStrategies.NotNull(nameof(registeredStrategies));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
using BBT.StructureTools.Extension;

/// <inheritdoc/>
public class EqualityComparerHelperRegistration<T> : IEqualityComparerHelperRegistration<T>
internal class EqualityComparerHelperRegistration<T> : IEqualityComparerHelperRegistration<T>
where T : class
{
private readonly ICollection<IEqualityComparerHelperStrategy<T>> registeredStrategies;

/// <summary>
/// Initializes a new instance of the <see cref="EqualityComparerHelperRegistration{T}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public EqualityComparerHelperRegistration()
{
this.registeredStrategies = new List<IEqualityComparerHelperStrategy<T>>();
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Compare/TypeComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
/// </summary>
internal sealed class TypeComparer : IComparer<Type>
{
/// <summary>
/// Initializes a new instance of the <see cref="TypeComparer"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public TypeComparer()
{
}

/// <inheritdoc/>
public int Compare(Type x, Type y)
{
Expand Down
13 changes: 12 additions & 1 deletion src/BBT.StructureTools/Convert/ConvertEngine.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
namespace BBT.StructureTools.Convert
{
/// <inheritdoc/>
public class ConvertEngine<TSource, TTarget> : IConvertEngine<TSource, TTarget>
internal class ConvertEngine<TSource, TTarget> : IConvertEngine<TSource, TTarget>
where TSource : class
where TTarget : class
{
/// <summary>
/// Initializes a new instance of the <see cref="ConvertEngine{TSource, TTarget}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public ConvertEngine()
{
}

/// <inheritdoc/>
public IConvertRegistration<TSource, TTarget> StartRegistrations()
{
Expand Down
13 changes: 12 additions & 1 deletion src/BBT.StructureTools/Convert/ConvertHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
using BBT.StructureTools.Extension;

/// <inheritdoc/>
public class ConvertHelper : IConvertHelper
internal class ConvertHelper : IConvertHelper
{
/// <summary>
/// Initializes a new instance of the <see cref="ConvertHelper"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public ConvertHelper()
{
}

/// <inheritdoc/>
public void DoConvertPreProcessing<TSourceClass, TTargetClass>(
TSourceClass source,
Expand Down
8 changes: 6 additions & 2 deletions src/BBT.StructureTools/Convert/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using BBT.StructureTools.Extension;

/// <inheritdoc/>
public class Converter<TSource, TTarget, TConvertIntention> : IConvert<TSource, TTarget, TConvertIntention>
internal class Converter<TSource, TTarget, TConvertIntention> : IConvert<TSource, TTarget, TConvertIntention>
where TSource : class
where TTarget : class
where TConvertIntention : IBaseConvertIntention
Expand All @@ -15,7 +15,11 @@ public class Converter<TSource, TTarget, TConvertIntention> : IConvert<TSource,
/// <summary>
/// Initializes a new instance of the <see cref="Converter{TSource, TTarget, TConvertIntention}" /> class.
/// </summary>
internal Converter(
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public Converter(
IConvertRegistrations<TSource, TTarget, TConvertIntention> convertRegistrations,
IConvertEngine<TSource, TTarget> convertEngine,
IConvertHelper convertHelper)
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Convert/Strategy/ConvertStrategyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
internal class ConvertStrategyProvider<TSource, TTarget, TIntention> : IConvertStrategyProvider<TSource, TTarget, TIntention>
where TIntention : IBaseConvertIntention
{
/// <summary>
/// Initializes a new instance of the <see cref="ConvertStrategyProvider{TSource, TTarget, TIntention}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public ConvertStrategyProvider()
{
}

/// <inheritdoc/>
public ISourceConvertStrategy<TSource, TTarget, TIntention> GetConvertStrategyFromSource(TSource source)
{
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Convert/Strategy/OperationCopySource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ internal class OperationCopySource<TSource, TTarget>
{
private Expression<Func<TTarget, TSource>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopySource{TSource, TTarget}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopySource()
{
}

/// <inheritdoc/>
public void Initialize(Expression<Func<TTarget, TSource>> targetExpression)
{
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Convert/Strategy/OperationCopyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ internal class OperationCopyValue<TSource, TTarget, TValue>
private Func<TSource, TValue> sourceFunc;
private Expression<Func<TTarget, TValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopyValue{TSource, TTarget, TValue}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopyValue()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TValue> sourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ internal class OperationCopyValueIfSourceNotDefault<TSource, TTarget, TValue>
private Func<TSource, TValue> sourceFunc;
private Expression<Func<TTarget, TValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopyValueIfSourceNotDefault{TSource, TTarget, TValue}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopyValueIfSourceNotDefault()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TValue> aSourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ internal class OperationCopyValueIfTargetIsDefault<TSource, TTarget, TValue>
private Func<TSource, TValue> sourceFunc;
private Expression<Func<TTarget, TValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopyValueIfTargetIsDefault{TSource, TTarget, TValue}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopyValueIfTargetIsDefault()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TValue> aSourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ internal class OperationCopyValueWithLookUp<TSource, TTarget, TValue>
private Func<TSource, TValue> sourceLookupFunc;
private Expression<Func<TTarget, TValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopyValueWithLookUp{TSource, TTarget, TValue}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopyValueWithLookUp()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TValue> aSourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ internal class OperationCopyValueWithSourceFilter<TSource, TTarget, TValue>
private Func<TSource, TTarget, TValue> sourceFunc;
private Expression<Func<TTarget, TValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopyValueWithSourceFilter{TSource, TTarget, TValue}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopyValueWithSourceFilter()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TTarget, TValue> sourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ internal class OperationCopyValueWithUpperLimit<TSource, TTarget, TValue>
private Func<TSource, TValue> sourceUpperLimitFunc;
private Expression<Func<TTarget, TValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCopyValueWithUpperLimit{TSource, TTarget, TValue}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCopyValueWithUpperLimit()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TValue> aSourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ internal class OperationCreateFromSourceWithReverseRelation<TSource, TTarget, TT
private ICreateConvertHelper<TSource, TTargetValue, TConcreteTargetValue, TTarget, TConvertIntention> createConvertHelper;
private Expression<Func<TTarget, TTargetValue>> targetExpression;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCreateFromSourceWithReverseRelation{TSource, TTarget, TTargetValue, TConcreteTargetValue, TConvertIntention}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCreateFromSourceWithReverseRelation()
{
}

/// <inheritdoc/>
public void Initialize(
Expression<Func<TTarget, TTargetValue>> targetExpression,
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Convert/Strategy/OperationCreateToOne.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ internal class OperationCreateToOne<TSource, TTarget, TSourceValue, TTargetValue
private Expression<Func<TTarget, TTargetValue>> targetExpression;
private ICreateConvertHelper<TSourceValue, TTargetValue, TConcreteTargetValue, TConvertIntention> createConvertHelper;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCreateToOne{TSource, TTarget, TSourceValue, TTargetValue, TConcreteTargetValue, TConvertIntention}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCreateToOne()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TSourceValue> sourceFunc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ internal class OperationCreateToOneWithReverseRelation<TSource, TTarget, TSource
private Expression<Func<TTarget, TTargetValue>> targetExpression;
private ICreateConvertHelper<TSourceValue, TTargetValue, TConcreteTargetValue, TTarget, TConvertIntention> createConvertHelper;

/// <summary>
/// Initializes a new instance of the <see cref="OperationCreateToOneWithReverseRelation{TSource, TTarget, TSourceValue, TTargetValue, TConcreteTargetValue, TConvertIntention}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public OperationCreateToOneWithReverseRelation()
{
}

/// <inheritdoc/>
public void Initialize(
Func<TSource, TSourceValue> sourceFunc,
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Convert/Value/ConvertValueRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ internal class ConvertValueRegistration<TSource, TTarget> : IConvertValueRegistr
{
private readonly IValueConvertMapping<TSource, TTarget> valueConvertMapping = new ValueConvertMapping<TSource, TTarget>();

/// <summary>
/// Initializes a new instance of the <see cref="ConvertValueRegistration{TSource, TTarget}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public ConvertValueRegistration()
{
}

/// <inheritdoc/>
public IConvertValueRegistration<TSource, TTarget> Register(TSource sourceValue, TTarget targetValue)
{
Expand Down
11 changes: 11 additions & 0 deletions src/BBT.StructureTools/Convert/Value/ValueConvertMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ internal class ValueConvertMapping<TSource, TTarget> : IValueConvertMapping<TSou
private readonly HashSet<TSource> mapToException = new HashSet<TSource>();
private Func<TTarget> nullCaseFunc;

/// <summary>
/// Initializes a new instance of the <see cref="ValueConvertMapping{TSource, TTarget}"/> class.
/// </summary>
/// <remarks>
/// This constructor is required and needs to be public because of the issue
/// described in GH-17.
/// </remarks>
public ValueConvertMapping()
{
}

/// <inheritdoc/>
public void AddException(TSource sourceValue)
{
Expand Down
Loading