Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit c7c612e

Browse files
committed
fix: Marked all implementations as Obsolete
BREAKING CHANGE: Deprecated package
1 parent abe4cf5 commit c7c612e

10 files changed

Lines changed: 32 additions & 6 deletions

src/Exceptions/CallMethodException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
namespace PowerUtils.xUnit.Extensions.Exceptions
44
{
55
[Serializable]
6+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
67
public class CallMethodException : Exception
78
{
89
public CallMethodException(string methodName)
910
: base($"It was not possible to call the method '{methodName}'") { }
1011
}
11-
}
12+
}

src/Exceptions/ConstructorNotFoundException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
namespace PowerUtils.xUnit.Extensions.Exceptions
44
{
55
[Serializable]
6+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
67
public class ConstructorNotFoundException : Exception
78
{
89
public ConstructorNotFoundException()
910
: base("Constructor not found") { }
1011
}
11-
}
12+
}

src/Exceptions/FieldNotFoundException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
namespace PowerUtils.xUnit.Extensions.Exceptions
44
{
55
[Serializable]
6+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
67
public class FieldNotFoundException : Exception
78
{
89
public FieldNotFoundException(string fieldName)
910
: base($"'{fieldName}' not found") { }
1011
}
11-
}
12+
}

src/Exceptions/MethodNotFoundException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
namespace PowerUtils.xUnit.Extensions.Exceptions
44
{
55
[Serializable]
6+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
67
public class MethodNotFoundException : Exception
78
{
89
public MethodNotFoundException(string methodName)
910
: base($"'{methodName}' not found") { }
1011
}
11-
}
12+
}

src/Exceptions/PropertyNotFoundException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
namespace PowerUtils.xUnit.Extensions.Exceptions
44
{
55
[Serializable]
6+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
67
public class PropertyNotFoundException : Exception
78
{
89
public PropertyNotFoundException(string propertyName)
910
: base($"'{propertyName}' not found") { }
1011
}
11-
}
12+
}

src/NonPublicMethodExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace PowerUtils.xUnit.Extensions
77
{
8+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
89
public static class NonPublicMethodExtensions
910
{
1011
/// <summary>
@@ -17,6 +18,7 @@ public static class NonPublicMethodExtensions
1718
/// <returns>Value returned from method</returns>
1819
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
1920
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
21+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
2022
public static TResult InvokeNonPublicMethod<TResult>(this object obj, string methodName, params object[] parameters)
2123
{
2224
if(obj is null)
@@ -51,6 +53,7 @@ public static TResult InvokeNonPublicMethod<TResult>(this object obj, string met
5153
/// <param name="parameters">Petermeters to send to non-public method</param>
5254
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
5355
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
56+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
5457
public static void InvokeNonPublicMethod(this object obj, string methodName, params object[] parameters)
5558
{
5659
if(obj is null)
@@ -87,6 +90,7 @@ public static void InvokeNonPublicMethod(this object obj, string methodName, par
8790
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
8891
/// <exception cref="CallMethodException">When it is not possible to call the method <paramref name="methodName">methodName</paramref></exception>
8992
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
93+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
9094
public static async Task<TResult> InvokeNonPublicMethodAsync<TResult>(this object obj, string methodName, params object[] parameters)
9195
{
9296
if(obj is null)
@@ -127,6 +131,7 @@ public static async Task<TResult> InvokeNonPublicMethodAsync<TResult>(this objec
127131
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
128132
/// <exception cref="CallMethodException">When it is not possible to call the method <paramref name="methodName">methodName</paramref></exception>
129133
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
134+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
130135
public static async Task InvokeNonPublicMethodAsync(this object obj, string methodName, params object[] parameters)
131136
{
132137
if(obj is null)

src/NonPublicPropertyExtensions.cs

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

66
namespace PowerUtils.xUnit.Extensions
77
{
8+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
89
public static class NonPublicPropertyExtensions
910
{
1011
/// <summary>
@@ -14,6 +15,7 @@ public static class NonPublicPropertyExtensions
1415
/// <param name="property">Target property</param>
1516
/// <param name="newValue">Value for property</param>
1617
/// <exception cref="ArgumentNullException">When the <paramref name="source">source</paramref> is null</exception>
18+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
1719
public static void SetNonPublicProperty<TSource, TProperty>(this TSource source, Expression<Func<TSource, TProperty>> property, TProperty newValue)
1820
{
1921
// https://softwareengineering.stackexchange.com/questions/304635/stubbing-properties-with-private-setters-for-tests
@@ -34,6 +36,7 @@ public static void SetNonPublicProperty<TSource, TProperty>(this TSource source,
3436
/// <param name="newValue">Value for property</param>
3537
/// <exception cref="ArgumentNullException">When the <paramref name="source">source</paramref> is null</exception>
3638
/// <exception cref="PropertyNotFoundException">When the <paramref name="propertyName">propertyName</paramref> not found</exception>
39+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
3740
public static void SetNonPublicProperty<TSource, TProperty>(this TSource source, string propertyName, TProperty newValue)
3841
{
3942
// https://stackoverflow.com/questions/1565734/is-it-possible-to-set-private-property-via-reflection
@@ -62,6 +65,7 @@ public static void SetNonPublicProperty<TSource, TProperty>(this TSource source,
6265
/// <param name="newValue">Value for field</param>
6366
/// <exception cref="ArgumentNullException">When the <paramref name="source">source</paramref> is null</exception>
6467
/// <exception cref="FieldNotFoundException">When the <paramref name="fieldName">propertyName</paramref> not found</exception>
68+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
6569
public static void SetNonPublicField<TSource, TField>(this TSource source, string fieldName, TField newValue)
6670
{
6771
if(source == null)

src/ObjectFactory.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
using System.Linq;
1+
using System;
2+
using System.Linq;
23
using System.Reflection;
34
using PowerUtils.xUnit.Extensions.Exceptions;
45

56
namespace PowerUtils.xUnit.Extensions
67
{
8+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
79
public static class ObjectFactory
810
{
11+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
912
public static TObject Create<TObject>(params object[] inputParameters)
1013
{
1114
var constructorList = typeof(TObject).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).ToList();

src/ObjectInvoker.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace PowerUtils.xUnit.Extensions
77
{
8+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
89
public class ObjectInvoker
910
{
1011
/// <summary>
@@ -17,6 +18,7 @@ public class ObjectInvoker
1718
/// <returns>Value returned from method</returns>
1819
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
1920
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
21+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
2022
public static TResult Invoke<TResult>(Type obj, string methodName, params object[] parameters)
2123
{
2224
if(obj is null)
@@ -50,6 +52,7 @@ public static TResult Invoke<TResult>(Type obj, string methodName, params object
5052
/// <param name="parameters">Petermeters to send to non-public method</param>
5153
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
5254
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
55+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
5356
public static void Invoke(Type obj, string methodName, params object[] parameters)
5457
{
5558
if(obj is null)
@@ -85,6 +88,7 @@ public static void Invoke(Type obj, string methodName, params object[] parameter
8588
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
8689
/// <exception cref="CallMethodException">When it is not possible to call the method <paramref name="methodName">methodName</paramref></exception>
8790
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
91+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
8892
public static async Task<TResult> InvokeAsync<TResult>(Type obj, string methodName, params object[] parameters)
8993
{
9094
if(obj is null)
@@ -124,6 +128,7 @@ public static async Task<TResult> InvokeAsync<TResult>(Type obj, string methodNa
124128
/// <exception cref="MethodNotFoundException">When the <paramref name="methodName">methodName</paramref> not found</exception>
125129
/// <exception cref="CallMethodException">When it is not possible to call the method <paramref name="methodName">methodName</paramref></exception>
126130
/// <exception cref="ArgumentNullException">When the <paramref name="obj">obj</paramref> is null</exception>
131+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
127132
public static async Task InvokeAsync(Type obj, string methodName, params object[] parameters)
128133
{
129134
if(obj is null)

src/OrderTests/PriorityOrderer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66

77
namespace PowerUtils.xUnit.Extensions.OrderTests
88
{
9+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
910
public class PriorityOrderer : ITestCaseOrderer
1011
{
12+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
1113
public const string Name = "PowerUtils.xUnit.Extensions.OrderTests.PriorityOrderer";
14+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
1215
public const string Assembly = "PowerUtils.xUnit.Extensions";
1316

17+
[Obsolete("This package has been discontinued because it never evolved, and the code present in this package does not justify its continuation. It is preferable to implement this code directly in the project if necessary.")]
1418
public IEnumerable<TTestCase> OrderTestCases<TTestCase>(IEnumerable<TTestCase> testCases)
1519
where TTestCase : ITestCase
1620
{

0 commit comments

Comments
 (0)