From 2ce4d66cfafa402ade7cf15434b536cc4127276f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihnea=20R=C4=83dulescu?= <> Date: Tue, 28 May 2024 20:01:29 +0300 Subject: [PATCH] Replaced Obsolete attributes in WhenCalled with doc comments. --- src/NSubstitute/Core/WhenCalled.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/NSubstitute/Core/WhenCalled.cs b/src/NSubstitute/Core/WhenCalled.cs index b1910cd7..6effb4c8 100644 --- a/src/NSubstitute/Core/WhenCalled.cs +++ b/src/NSubstitute/Core/WhenCalled.cs @@ -7,9 +7,6 @@ namespace NSubstitute.Core; public class WhenCalled(ISubstitutionContext context, T substitute, Action call, MatchArgs matchArgs) { - private const string RecommendedThrowMethodToUseMessage = - "The recommended method to use is Throw()."; - private readonly ICallRouter _callRouter = context.GetCallRouterFor(substitute!); private readonly IThreadLocalContext _threadContext = context.ThreadContext; private readonly IRouteFactory _routeFactory = context.RouteFactory; @@ -77,21 +74,21 @@ public void Throw(Func createException) => /// /// Throws the specified exception when called. /// - [Obsolete(RecommendedThrowMethodToUseMessage)] + /// Prefer for readability. public void Throws(Exception exception) => Throw(exception); /// /// Throws an exception of the given type when called. /// - [Obsolete(RecommendedThrowMethodToUseMessage)] + /// Prefer for readability. public TException Throws() where TException : Exception, new() => Throw(); /// /// Throws an exception generated by the specified function when called. /// - [Obsolete(RecommendedThrowMethodToUseMessage)] + /// Prefer for readability. public void Throws(Func createException) => Throw(createException); } \ No newline at end of file