diff --git a/src/Dependency/Injection/Abstracts/ParameterBase.cs b/src/Dependency/Injection/Abstracts/ParameterBase.cs
index 481f11f..e601397 100644
--- a/src/Dependency/Injection/Abstracts/ParameterBase.cs
+++ b/src/Dependency/Injection/Abstracts/ParameterBase.cs
@@ -1,5 +1,4 @@
using System;
-using System.Diagnostics;
using System.Reflection;
namespace Unity.Injection
@@ -8,7 +7,6 @@ namespace Unity.Injection
/// A base class for implementing classes
/// that deal in explicit types.
///
- [DebuggerDisplay("Parameter: {ParameterType?.Name ?? \"Any Type\"}")]
public abstract class ParameterBase : ParameterValue
{
#region Fields
diff --git a/src/Dependency/Injection/Parameters/GenericParameter.cs b/src/Dependency/Injection/Parameters/GenericParameter.cs
index e095706..3e30dbf 100644
--- a/src/Dependency/Injection/Parameters/GenericParameter.cs
+++ b/src/Dependency/Injection/Parameters/GenericParameter.cs
@@ -1,9 +1,12 @@
-namespace Unity.Injection
+using System.Diagnostics;
+
+namespace Unity.Injection
{
///
/// A that lets you specify that
/// an instance of a generic type parameter should be resolved.
///
+ [DebuggerDisplay("GenericParameter: Type={ParameterTypeName}")]
public class GenericParameter : GenericBase
{
#region Constructors
@@ -28,5 +31,15 @@
{ }
#endregion
+
+
+ #region Overrides
+
+ public override string ToString()
+ {
+ return $"GenericParameter: Type={ParameterTypeName}";
+ }
+
+ #endregion
}
}
diff --git a/src/Dependency/Injection/Parameters/GenericResolvedArrayParameter.cs b/src/Dependency/Injection/Parameters/GenericResolvedArrayParameter.cs
index 65e36c4..431eaef 100644
--- a/src/Dependency/Injection/Parameters/GenericResolvedArrayParameter.cs
+++ b/src/Dependency/Injection/Parameters/GenericResolvedArrayParameter.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
using Unity.Resolution;
@@ -10,6 +11,7 @@ namespace Unity.Injection
/// an array containing the registered instances of a generic type parameter
/// should be resolved.
///
+ [DebuggerDisplay("GenericResolvedArrayParameter: Type={ParameterTypeName}")]
public class GenericResolvedArrayParameter : GenericBase
{
#region Fields
@@ -88,6 +90,11 @@ namespace Unity.Injection
return (ref TContext context) => resolverMethod.Invoke(ref context, values);
}
+ public override string ToString()
+ {
+ return $"GenericResolvedArrayParameter: Type={ParameterTypeName}";
+ }
+
#endregion
diff --git a/src/Dependency/Injection/Parameters/InjectionParameter.cs b/src/Dependency/Injection/Parameters/InjectionParameter.cs
index 9be1036..6a2ae57 100644
--- a/src/Dependency/Injection/Parameters/InjectionParameter.cs
+++ b/src/Dependency/Injection/Parameters/InjectionParameter.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using Unity.Resolution;
namespace Unity.Injection
@@ -8,6 +9,7 @@ namespace Unity.Injection
/// the required
/// when the container is configured.
///
+ [DebuggerDisplay("InjectionParameter: Type={ParameterType.Name ?? \"Any\"} Value={_value ?? \"null\"}")]
public class InjectionParameter : ParameterBase, IResolve
{
#region Fields
@@ -55,6 +57,16 @@ namespace Unity.Injection
}
#endregion
+
+
+ #region Overrides
+
+ public override string ToString()
+ {
+ return $"InjectionParameter: Type={ParameterType.Name} Value={_value ?? "null"}";
+ }
+
+ #endregion
}
///
diff --git a/src/Dependency/Injection/Parameters/OptionalParameter.cs b/src/Dependency/Injection/Parameters/OptionalParameter.cs
index 7a3eb5a..95186c7 100644
--- a/src/Dependency/Injection/Parameters/OptionalParameter.cs
+++ b/src/Dependency/Injection/Parameters/OptionalParameter.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using System.Reflection;
using Unity.Exceptions;
using Unity.Resolution;
@@ -10,6 +11,7 @@ namespace Unity.Injection
/// to configure a
/// parameter or property as an optional dependency.
///
+ [DebuggerDisplay("OptionalParameter: Type={ParameterType?.Name ?? \"Any\"} Name={_name ?? \"null\"}")]
public class OptionalParameter : ParameterBase,
IResolverFactory,
IResolverFactory
@@ -126,6 +128,16 @@ namespace Unity.Injection
}
#endregion
+
+
+ #region Overrides
+
+ public override string ToString()
+ {
+ return $"OptionalParameter: Type={ParameterType?.Name ?? "Any"} Name={_name ?? "null"}";
+ }
+
+ #endregion
}
///
diff --git a/src/Dependency/Injection/Parameters/ResolvedArrayParameter.cs b/src/Dependency/Injection/Parameters/ResolvedArrayParameter.cs
index 6da8dab..9ee4ad3 100644
--- a/src/Dependency/Injection/Parameters/ResolvedArrayParameter.cs
+++ b/src/Dependency/Injection/Parameters/ResolvedArrayParameter.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
using Unity.Resolution;
@@ -10,6 +11,7 @@ namespace Unity.Injection
/// resolver object that resolves all the named instances or the
/// type registered in a container.
///
+ [DebuggerDisplay("ResolvedArrayParameter: Type={ParameterType.Name}")]
public class ResolvedArrayParameter : ParameterBase,
IResolverFactory,
IResolverFactory
@@ -136,6 +138,16 @@ namespace Unity.Injection
#endregion
+ #region Overrides
+
+ public override string ToString()
+ {
+ return $"ResolvedArrayParameter: Type={ParameterType.Name}";
+ }
+
+ #endregion
+
+
#region Implementation
private static object DoResolve(ref TContext context, object[] values)
diff --git a/src/Dependency/Injection/Parameters/ResolvedParameter.cs b/src/Dependency/Injection/Parameters/ResolvedParameter.cs
index 12e8e2a..38fc93f 100644
--- a/src/Dependency/Injection/Parameters/ResolvedParameter.cs
+++ b/src/Dependency/Injection/Parameters/ResolvedParameter.cs
@@ -1,4 +1,5 @@
using System;
+using System.Diagnostics;
using System.Reflection;
using Unity.Resolution;
@@ -9,6 +10,7 @@ namespace Unity.Injection
/// resolver object that resolves the parameter via the
/// container.
///
+ [DebuggerDisplay("ResolvedParameter: Type={ParameterType?.Name ?? \"Any\"} Name={_name ?? \"null\"}")]
public class ResolvedParameter : ParameterBase,
IResolverFactory,
IResolverFactory
@@ -105,6 +107,16 @@ namespace Unity.Injection
}
#endregion
+
+
+ #region Overrides
+
+ public override string ToString()
+ {
+ return $"ResolvedParameter: Type={ParameterType?.Name ?? "Any"} Name={_name ?? "null"}";
+ }
+
+ #endregion
}
///
diff --git a/tests/Dependency/Injection/Parameters/ParameterBaseData.cs b/tests/Dependency/Injection/Parameters/ParameterBaseData.cs
new file mode 100644
index 0000000..82283ef
--- /dev/null
+++ b/tests/Dependency/Injection/Parameters/ParameterBaseData.cs
@@ -0,0 +1,152 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Unity.Injection;
+
+namespace Injection.Parameters
+{
+ public class ParameterBaseData
+ {
+ #region Test Data
+
+ private static ParameterInfo ParamInfo =
+ typeof(ParameterValueTests).GetMethod(nameof(GenericBaseTestMethod))
+ .GetParameters()
+ .First();
+
+ private static ParameterInfo ArrayInfo =
+ typeof(ParameterValueTests).GetMethod(nameof(GenericBaseTestMethod))
+ .GetParameters()
+ .Last();
+
+ private static ParameterInfo AddInfo =
+ typeof(List<>).GetMethod("Add")
+ .GetParameters()
+ .First();
+
+ private static ParameterInfo AddStringInfo =
+ typeof(List).GetMethod("Add")
+ .GetParameters()
+ .First();
+
+ public void GenericBaseTestMethod(TName value, TArray[] array) => throw new NotImplementedException();
+
+ #endregion
+
+ public static IEnumerable