diff --git a/BreakingChanges.md b/BreakingChanges.md
index d65217ba..2f696601 100644
--- a/BreakingChanges.md
+++ b/BreakingChanges.md
@@ -5,6 +5,7 @@
* Obsolete api is removed
* CompatArg is marked as obsolete
* Nullability is enabled for public api for .NET 8+. Workaround: you can disable nullability `disable` on project if you don't want to use it. more info https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references
+* Move some core type into NSubstitute.Internal namespace. Types from internal namespace could be removed\changed without notification in next version. Try to avoid using them directly.
5.0.0 Release
================
diff --git a/CHANGELOG.md b/CHANGELOG.md
index afa8dcea..bd563ef4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@
* [NEW] Added .NET 9 to test matrix
* [UPDATE] Migrate documentation to docfx platform. https://github.com/dotnet/docfx
* [UPDATE][BREAKING] Nullability is enabled for public api for .NET Core TFMs
+* [UPDATE][BREAKING] Move some core type into NSubstitute.Internal namespace. Types from internal namespace could be removed\changed without notification in next version. Try to avoid using them directly.
### 5.3.0 (October 2024)
diff --git a/NSubstitute.sln b/NSubstitute.sln
deleted file mode 100644
index eae31164..00000000
--- a/NSubstitute.sln
+++ /dev/null
@@ -1,60 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.8.34309.116
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSubstitute", "src\NSubstitute\NSubstitute.csproj", "{F59BF5FC-52D8-492E-BDE8-244C183B4C92}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CFB6BF4B-381D-4884-A8E8-D1FA71315BDE}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0E2B9095-7548-462F-9BCC-CD6765B3ED60}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{A8AF7D01-6CE4-47B2-9E23-689A53991C3D}"
- ProjectSection(SolutionItems) = preProject
- build\build.fs = build\build.fs
- build\ExtractDocs.fs = build\ExtractDocs.fs
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CA2DD4AA-8DCD-42FB-8081-243281AD2956}"
- ProjectSection(SolutionItems) = preProject
- .editorconfig = .editorconfig
- BreakingChanges.md = BreakingChanges.md
- CHANGELOG.md = CHANGELOG.md
- Directory.Build.props = Directory.Build.props
- README.md = README.md
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSubstitute.Acceptance.Specs", "tests\NSubstitute.Acceptance.Specs\NSubstitute.Acceptance.Specs.csproj", "{8C2300AA-F94C-4005-A359-257C5EAD338E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSubstitute.Benchmarks", "tests\NSubstitute.Benchmarks\NSubstitute.Benchmarks.csproj", "{D2D162D4-EF1D-4B40-8736-9228C2FEA16C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F59BF5FC-52D8-492E-BDE8-244C183B4C92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F59BF5FC-52D8-492E-BDE8-244C183B4C92}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F59BF5FC-52D8-492E-BDE8-244C183B4C92}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F59BF5FC-52D8-492E-BDE8-244C183B4C92}.Release|Any CPU.Build.0 = Release|Any CPU
- {8C2300AA-F94C-4005-A359-257C5EAD338E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8C2300AA-F94C-4005-A359-257C5EAD338E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8C2300AA-F94C-4005-A359-257C5EAD338E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8C2300AA-F94C-4005-A359-257C5EAD338E}.Release|Any CPU.Build.0 = Release|Any CPU
- {D2D162D4-EF1D-4B40-8736-9228C2FEA16C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D2D162D4-EF1D-4B40-8736-9228C2FEA16C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D2D162D4-EF1D-4B40-8736-9228C2FEA16C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D2D162D4-EF1D-4B40-8736-9228C2FEA16C}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {F59BF5FC-52D8-492E-BDE8-244C183B4C92} = {CFB6BF4B-381D-4884-A8E8-D1FA71315BDE}
- {8C2300AA-F94C-4005-A359-257C5EAD338E} = {0E2B9095-7548-462F-9BCC-CD6765B3ED60}
- {D2D162D4-EF1D-4B40-8736-9228C2FEA16C} = {0E2B9095-7548-462F-9BCC-CD6765B3ED60}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {230E97F1-5246-4D49-8ED9-065F2B154E93}
- EndGlobalSection
-EndGlobal
diff --git a/NSubstitute.slnx b/NSubstitute.slnx
new file mode 100644
index 00000000..f4a719ad
--- /dev/null
+++ b/NSubstitute.slnx
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index a3210e00..29cfad4f 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
NSubstitute
========
-[](https://github.com/nsubstitute/NSubstitute/actions/workflows/test.yml)
+[](https://github.com/nsubstitute/NSubstitute/actions/workflows/test.yml)
[](https://www.nuget.org/packages/NSubstitute)
Visit the [NSubstitute website](https://nsubstitute.github.io) for more information.
diff --git a/build/ExtractDocs.fs b/build/ExtractDocs.fs
index bc4ad516..1425b9d0 100644
--- a/build/ExtractDocs.fs
+++ b/build/ExtractDocs.fs
@@ -36,7 +36,6 @@ using System.Collections.Generic;
using System.ComponentModel;
using NSubstitute.Extensions;
using NSubstitute.Compatibility;
-using NSubstitute.ExceptionExtensions;
namespace NSubstitute.Samples {
public class Tests_%s {
diff --git a/docs/docs/2010-05-02-throwing-exceptions.md b/docs/docs/2010-05-02-throwing-exceptions.md
index c19f1ca7..0b061e3b 100644
--- a/docs/docs/2010-05-02-throwing-exceptions.md
+++ b/docs/docs/2010-05-02-throwing-exceptions.md
@@ -10,7 +10,7 @@ ICalculator calculator;
```
-->
-The `Throws` and `ThrowsAsync` helpers in the `NSubstitute.ExceptionExtensions` namespace can be used to throw exceptions when a member is called.
+The `Throws` and `ThrowsAsync` helpers in the `NSubstitute.Extensions` namespace can be used to throw exceptions when a member is called.
```csharp
//For non-voids:
diff --git a/src/NSubstitute/Arg.cs b/src/NSubstitute/Arg.cs
index 83f36933..449ade04 100644
--- a/src/NSubstitute/Arg.cs
+++ b/src/NSubstitute/Arg.cs
@@ -1,4 +1,5 @@
using NSubstitute.Core.Arguments;
+using NSubstitute.Internal.Core.Arguments;
using System.Linq.Expressions;
namespace NSubstitute;
diff --git a/src/NSubstitute/Core/Arguments/ArgumentMatcher.cs b/src/NSubstitute/Core/Arguments/ArgumentMatcher.cs
index 1b62dea7..5d1fa83e 100644
--- a/src/NSubstitute/Core/Arguments/ArgumentMatcher.cs
+++ b/src/NSubstitute/Core/Arguments/ArgumentMatcher.cs
@@ -1,4 +1,5 @@
using NSubstitute.Exceptions;
+using NSubstitute.Internal.Core.Arguments;
namespace NSubstitute.Core.Arguments;
diff --git a/src/NSubstitute/Core/Arguments/IArgumentSpecificationsFactory.cs b/src/NSubstitute/Core/Arguments/IArgumentSpecificationsFactory.cs
index a174ee0f..977a9309 100644
--- a/src/NSubstitute/Core/Arguments/IArgumentSpecificationsFactory.cs
+++ b/src/NSubstitute/Core/Arguments/IArgumentSpecificationsFactory.cs
@@ -1,3 +1,4 @@
+using NSubstitute.Internal.Core;
using System.Reflection;
namespace NSubstitute.Core.Arguments;
diff --git a/src/NSubstitute/Core/CallInfo.cs b/src/NSubstitute/Core/CallInfo.cs
index d21e4d2a..f993ba50 100644
--- a/src/NSubstitute/Core/CallInfo.cs
+++ b/src/NSubstitute/Core/CallInfo.cs
@@ -1,5 +1,5 @@
-using System.Diagnostics.CodeAnalysis;
using NSubstitute.Exceptions;
+using System.Diagnostics.CodeAnalysis;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/DependencyInjection/NSubContainer.cs b/src/NSubstitute/Core/DependencyInjection/NSubContainer.cs
index db90cccf..35351983 100644
--- a/src/NSubstitute/Core/DependencyInjection/NSubContainer.cs
+++ b/src/NSubstitute/Core/DependencyInjection/NSubContainer.cs
@@ -137,7 +137,7 @@ private void SetRegistration(Type type, Registration registration)
}
}
- private class Registration(Func factory, NSubLifetime lifetime)
+ private class Registration(Func factory, NSubLifetime lifetime)
{
private object? _singletonValue;
public NSubLifetime Lifetime { get; } = lifetime;
diff --git a/src/NSubstitute/Core/DependencyInjection/NSubstituteDefaultFactory.cs b/src/NSubstitute/Core/DependencyInjection/NSubstituteDefaultFactory.cs
index c532475e..b0f77d64 100644
--- a/src/NSubstitute/Core/DependencyInjection/NSubstituteDefaultFactory.cs
+++ b/src/NSubstitute/Core/DependencyInjection/NSubstituteDefaultFactory.cs
@@ -1,7 +1,9 @@
using NSubstitute.Core.Arguments;
-using NSubstitute.Proxies.CastleDynamicProxy;
-using NSubstitute.Routing;
-using NSubstitute.Routing.AutoValues;
+using NSubstitute.Internal.Core;
+using NSubstitute.Internal.Core.Arguments;
+using NSubstitute.Internal.Proxies.CastleDynamicProxy;
+using NSubstitute.Internal.Routing;
+using NSubstitute.Internal.Routing.AutoValues;
namespace NSubstitute.Core.DependencyInjection;
diff --git a/src/NSubstitute/Core/ICall.cs b/src/NSubstitute/Core/ICall.cs
index fb2fbc22..3baae6e3 100644
--- a/src/NSubstitute/Core/ICall.cs
+++ b/src/NSubstitute/Core/ICall.cs
@@ -1,5 +1,6 @@
using System.Reflection;
using NSubstitute.Core.Arguments;
+using NSubstitute.Internal.Core;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/ICallRouter.cs b/src/NSubstitute/Core/ICallRouter.cs
index df061f88..714904a0 100644
--- a/src/NSubstitute/Core/ICallRouter.cs
+++ b/src/NSubstitute/Core/ICallRouter.cs
@@ -1,3 +1,5 @@
+using NSubstitute.Internal.Core;
+
namespace NSubstitute.Core;
public interface ICallRouter
diff --git a/src/NSubstitute/Core/ICallSpecification.cs b/src/NSubstitute/Core/ICallSpecification.cs
index 64375ce1..154637c6 100644
--- a/src/NSubstitute/Core/ICallSpecification.cs
+++ b/src/NSubstitute/Core/ICallSpecification.cs
@@ -1,5 +1,5 @@
using System.Reflection;
-using NSubstitute.Core.Arguments;
+using NSubstitute.Internal.Core.Arguments;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/ICallSpecificationFactory.cs b/src/NSubstitute/Core/ICallSpecificationFactory.cs
index 252bebef..3f73f20d 100644
--- a/src/NSubstitute/Core/ICallSpecificationFactory.cs
+++ b/src/NSubstitute/Core/ICallSpecificationFactory.cs
@@ -1,3 +1,5 @@
+using NSubstitute.Internal.Core;
+
namespace NSubstitute.Core;
public interface ICallSpecificationFactory
diff --git a/src/NSubstitute/Core/IConfigureCall.cs b/src/NSubstitute/Core/IConfigureCall.cs
index bcd5d3c9..f3dc122a 100644
--- a/src/NSubstitute/Core/IConfigureCall.cs
+++ b/src/NSubstitute/Core/IConfigureCall.cs
@@ -1,3 +1,5 @@
+using NSubstitute.Internal.Core;
+
namespace NSubstitute.Core;
public interface IConfigureCall
diff --git a/src/NSubstitute/Core/IDescribeNonMatches.cs b/src/NSubstitute/Core/IDescribeNonMatches.cs
index 94814ce6..9c088e89 100644
--- a/src/NSubstitute/Core/IDescribeNonMatches.cs
+++ b/src/NSubstitute/Core/IDescribeNonMatches.cs
@@ -2,7 +2,7 @@ namespace NSubstitute.Core;
///
/// A type that can describe how an argument does not match a required condition.
-/// Use in conjunction with to provide information about
+/// Use in conjunction with to provide information about
/// non-matches.
///
public interface IDescribeNonMatches
diff --git a/src/NSubstitute/Core/IDescribeSpecification.cs b/src/NSubstitute/Core/IDescribeSpecification.cs
index b6d30765..0d91bae4 100644
--- a/src/NSubstitute/Core/IDescribeSpecification.cs
+++ b/src/NSubstitute/Core/IDescribeSpecification.cs
@@ -2,7 +2,7 @@ namespace NSubstitute.Core;
///
/// A type that can describe the required conditions to meet a specification.
-/// Use in conjunction with to provide information about
+/// Use in conjunction with to provide information about
/// what it requires to match an argument.
///
public interface IDescribeSpecification
diff --git a/src/NSubstitute/Core/IGetCallSpec.cs b/src/NSubstitute/Core/IGetCallSpec.cs
index 7253546c..654f696b 100644
--- a/src/NSubstitute/Core/IGetCallSpec.cs
+++ b/src/NSubstitute/Core/IGetCallSpec.cs
@@ -1,4 +1,6 @@
-namespace NSubstitute.Core;
+using NSubstitute.Internal.Core;
+
+namespace NSubstitute.Core;
public interface IGetCallSpec
{
diff --git a/src/NSubstitute/Core/IPendingSpecification.cs b/src/NSubstitute/Core/IPendingSpecification.cs
index c10c5bc0..ca08a76e 100644
--- a/src/NSubstitute/Core/IPendingSpecification.cs
+++ b/src/NSubstitute/Core/IPendingSpecification.cs
@@ -1,4 +1,6 @@
-namespace NSubstitute.Core;
+using NSubstitute.Internal.Core;
+
+namespace NSubstitute.Core;
public interface IPendingSpecification
{
diff --git a/src/NSubstitute/Core/IQueryResults.cs b/src/NSubstitute/Core/IQueryResults.cs
index 5ecce207..1c9e6f84 100644
--- a/src/NSubstitute/Core/IQueryResults.cs
+++ b/src/NSubstitute/Core/IQueryResults.cs
@@ -1,3 +1,5 @@
+using NSubstitute.Internal.Core;
+
namespace NSubstitute.Core;
public interface IQueryResults
diff --git a/src/NSubstitute/Core/IReceivedCallsExceptionThrower.cs b/src/NSubstitute/Core/IReceivedCallsExceptionThrower.cs
index a712907f..5e5c3d45 100644
--- a/src/NSubstitute/Core/IReceivedCallsExceptionThrower.cs
+++ b/src/NSubstitute/Core/IReceivedCallsExceptionThrower.cs
@@ -1,4 +1,4 @@
-using NSubstitute.ReceivedExtensions;
+using NSubstitute.Extensions;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/IReturn.cs b/src/NSubstitute/Core/IReturn.cs
index 92cfd56b..dbdc36d9 100644
--- a/src/NSubstitute/Core/IReturn.cs
+++ b/src/NSubstitute/Core/IReturn.cs
@@ -1,6 +1,7 @@
using System.Collections.Concurrent;
using System.Reflection;
using NSubstitute.Exceptions;
+using NSubstitute.Internal.Core;
namespace NSubstitute.Core;
@@ -38,7 +39,7 @@ public class ReturnValueFromFunc(Func? funcToReturnValue) : IRe
private static Func ReturnNull()
{
if (typeof(T).GetTypeInfo().IsValueType) throw new CannotReturnNullForValueType(typeof(T));
- return x => default(T);
+ return x => default;
}
}
diff --git a/src/NSubstitute/Core/ISubstituteState.cs b/src/NSubstitute/Core/ISubstituteState.cs
index 4910bb5b..1c5d662f 100644
--- a/src/NSubstitute/Core/ISubstituteState.cs
+++ b/src/NSubstitute/Core/ISubstituteState.cs
@@ -1,4 +1,4 @@
-using NSubstitute.Routing.AutoValues;
+using NSubstitute.Internal.Routing.AutoValues;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/ISubstitutionContext.cs b/src/NSubstitute/Core/ISubstitutionContext.cs
index fb349c68..63c668ab 100644
--- a/src/NSubstitute/Core/ISubstitutionContext.cs
+++ b/src/NSubstitute/Core/ISubstitutionContext.cs
@@ -1,4 +1,4 @@
-using NSubstitute.Routing;
+using NSubstitute.Internal.Routing;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/IThreadLocalContext.cs b/src/NSubstitute/Core/IThreadLocalContext.cs
index 209eac16..f3adf55d 100644
--- a/src/NSubstitute/Core/IThreadLocalContext.cs
+++ b/src/NSubstitute/Core/IThreadLocalContext.cs
@@ -1,5 +1,6 @@
using NSubstitute.Core.Arguments;
-using NSubstitute.Routing;
+using NSubstitute.Internal.Core;
+using NSubstitute.Internal.Routing;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Core/SubstitutionContext.cs b/src/NSubstitute/Core/SubstitutionContext.cs
index 09e9bc92..44aaf259 100644
--- a/src/NSubstitute/Core/SubstitutionContext.cs
+++ b/src/NSubstitute/Core/SubstitutionContext.cs
@@ -1,5 +1,5 @@
using NSubstitute.Core.DependencyInjection;
-using NSubstitute.Routing;
+using NSubstitute.Internal.Routing;
namespace NSubstitute.Core;
diff --git a/src/NSubstitute/Exceptions/AmbiguousArgumentsException.cs b/src/NSubstitute/Exceptions/AmbiguousArgumentsException.cs
index 51625d85..a126ea72 100644
--- a/src/NSubstitute/Exceptions/AmbiguousArgumentsException.cs
+++ b/src/NSubstitute/Exceptions/AmbiguousArgumentsException.cs
@@ -1,8 +1,9 @@
using System.Collections;
using System.Reflection;
using System.Text;
-using NSubstitute.Core;
using NSubstitute.Core.Arguments;
+using NSubstitute.Internal.Core;
+using NSubstitute.Internal.Core.Arguments;
using static System.Environment;
namespace NSubstitute.Exceptions;
diff --git a/src/NSubstitute/Extensions/ClearExtensions.cs b/src/NSubstitute/Extensions/ClearExtensions.cs
index 9842be1d..4ba43c55 100644
--- a/src/NSubstitute/Extensions/ClearExtensions.cs
+++ b/src/NSubstitute/Extensions/ClearExtensions.cs
@@ -1,7 +1,7 @@
-using NSubstitute.Core;
-using NSubstitute.Exceptions;
+using NSubstitute.Exceptions;
+using NSubstitute.Core;
-namespace NSubstitute.ClearExtensions;
+namespace NSubstitute.Extensions;
public static class ClearExtensions
{
diff --git a/src/NSubstitute/Extensions/ConfigurationExtensions.cs b/src/NSubstitute/Extensions/ConfigurationExtensions.cs
index de225007..5b660391 100644
--- a/src/NSubstitute/Extensions/ConfigurationExtensions.cs
+++ b/src/NSubstitute/Extensions/ConfigurationExtensions.cs
@@ -1,5 +1,5 @@
-using NSubstitute.Core;
-using NSubstitute.Exceptions;
+using NSubstitute.Exceptions;
+using NSubstitute.Core;
namespace NSubstitute.Extensions;
diff --git a/src/NSubstitute/Extensions/ExceptionExtensions.cs b/src/NSubstitute/Extensions/ExceptionExtensions.cs
index 43636b67..12bede33 100644
--- a/src/NSubstitute/Extensions/ExceptionExtensions.cs
+++ b/src/NSubstitute/Extensions/ExceptionExtensions.cs
@@ -1,7 +1,8 @@
using NSubstitute.Core;
+using NSubstitute.Internal.Core;
using System.Reflection;
-namespace NSubstitute.ExceptionExtensions;
+namespace NSubstitute.Extensions;
public static class ExceptionExtensions
{
diff --git a/src/NSubstitute/Extensions/ProtectedExtensions.cs b/src/NSubstitute/Extensions/ProtectedExtensions.cs
index af57b29c..88635ffc 100644
--- a/src/NSubstitute/Extensions/ProtectedExtensions.cs
+++ b/src/NSubstitute/Extensions/ProtectedExtensions.cs
@@ -1,7 +1,8 @@
using System.Reflection;
+using NSubstitute.Internal.Core;
+using NSubstitute.Exceptions;
using NSubstitute.Core;
using NSubstitute.Core.Arguments;
-using NSubstitute.Exceptions;
// Disable nullability for client API, so it does not affect clients.
#nullable disable annotations
diff --git a/src/NSubstitute/Extensions/ReceivedExtensions.cs b/src/NSubstitute/Extensions/ReceivedExtensions.cs
index 9825a46a..fd5c2a41 100644
--- a/src/NSubstitute/Extensions/ReceivedExtensions.cs
+++ b/src/NSubstitute/Extensions/ReceivedExtensions.cs
@@ -1,7 +1,8 @@
using NSubstitute.Core;
using NSubstitute.Exceptions;
+using NSubstitute.Internal.Core;
-namespace NSubstitute.ReceivedExtensions;
+namespace NSubstitute.Extensions;
public static class ReceivedExtensions
{
@@ -143,7 +144,7 @@ public RangeQuantity(int minInclusive, int maxInclusive)
this.maxInclusive = maxInclusive;
}
public override string Describe(string singularNoun, string pluralNoun) =>
- $"between {minInclusive} and {maxInclusive} (inclusive) {((maxInclusive == 1) ? singularNoun : pluralNoun)}";
+ $"between {minInclusive} and {maxInclusive} (inclusive) {(maxInclusive == 1 ? singularNoun : pluralNoun)}";
public override bool Matches(IEnumerable items)
{
diff --git a/src/NSubstitute/Extensions/ReturnsExtensions.cs b/src/NSubstitute/Extensions/ReturnsExtensions.cs
index 29457d98..2a37b8ce 100644
--- a/src/NSubstitute/Extensions/ReturnsExtensions.cs
+++ b/src/NSubstitute/Extensions/ReturnsExtensions.cs
@@ -1,7 +1,7 @@
-using NSubstitute.Core;
+using NSubstitute.Internal.Core;
-namespace NSubstitute.ReturnsExtensions;
+namespace NSubstitute.Extensions;
public static class ReturnsExtensions
{
diff --git a/src/NSubstitute/Core/ArgumentSpecificationDequeue.cs b/src/NSubstitute/Internal/Core/ArgumentSpecificationDequeue.cs
similarity index 89%
rename from src/NSubstitute/Core/ArgumentSpecificationDequeue.cs
rename to src/NSubstitute/Internal/Core/ArgumentSpecificationDequeue.cs
index 87d719a0..963bad2d 100644
--- a/src/NSubstitute/Core/ArgumentSpecificationDequeue.cs
+++ b/src/NSubstitute/Internal/Core/ArgumentSpecificationDequeue.cs
@@ -1,6 +1,7 @@
-using NSubstitute.Core.Arguments;
+using NSubstitute.Core;
+using NSubstitute.Core.Arguments;
-namespace NSubstitute.Core;
+namespace NSubstitute.Internal.Core;
public class ArgumentSpecificationDequeue(Func> dequeueAllQueuedArgSpecs) : IArgumentSpecificationDequeue
{
diff --git a/src/NSubstitute/Core/Arguments/AnyArgumentMatcher.cs b/src/NSubstitute/Internal/Core/Arguments/AnyArgumentMatcher.cs
similarity index 78%
rename from src/NSubstitute/Core/Arguments/AnyArgumentMatcher.cs
rename to src/NSubstitute/Internal/Core/Arguments/AnyArgumentMatcher.cs
index 82b083d0..3cef1acd 100644
--- a/src/NSubstitute/Core/Arguments/AnyArgumentMatcher.cs
+++ b/src/NSubstitute/Internal/Core/Arguments/AnyArgumentMatcher.cs
@@ -1,4 +1,6 @@
-namespace NSubstitute.Core.Arguments;
+using NSubstitute.Core.Arguments;
+
+namespace NSubstitute.Internal.Core.Arguments;
public class AnyArgumentMatcher(Type typeArgMustBeCompatibleWith) : IArgumentMatcher
{
diff --git a/src/NSubstitute/Core/Arguments/ArgumentFormatter.cs b/src/NSubstitute/Internal/Core/Arguments/ArgumentFormatter.cs
similarity index 90%
rename from src/NSubstitute/Core/Arguments/ArgumentFormatter.cs
rename to src/NSubstitute/Internal/Core/Arguments/ArgumentFormatter.cs
index 1bfb5ff7..6ae7827a 100644
--- a/src/NSubstitute/Core/Arguments/ArgumentFormatter.cs
+++ b/src/NSubstitute/Internal/Core/Arguments/ArgumentFormatter.cs
@@ -1,4 +1,6 @@
-namespace NSubstitute.Core.Arguments;
+using NSubstitute.Core.Arguments;
+
+namespace NSubstitute.Internal.Core.Arguments;
public class ArgumentFormatter : IArgumentFormatter
{
diff --git a/src/NSubstitute/Core/Arguments/ArgumentMatchInfo.cs b/src/NSubstitute/Internal/Core/Arguments/ArgumentMatchInfo.cs
similarity index 90%
rename from src/NSubstitute/Core/Arguments/ArgumentMatchInfo.cs
rename to src/NSubstitute/Internal/Core/Arguments/ArgumentMatchInfo.cs
index 817f5f7a..5db22e84 100644
--- a/src/NSubstitute/Core/Arguments/ArgumentMatchInfo.cs
+++ b/src/NSubstitute/Internal/Core/Arguments/ArgumentMatchInfo.cs
@@ -1,4 +1,6 @@
-namespace NSubstitute.Core.Arguments;
+using NSubstitute.Core.Arguments;
+
+namespace NSubstitute.Internal.Core.Arguments;
public record ArgumentMatchInfo
{
diff --git a/src/NSubstitute/Core/Arguments/ArgumentSpecification.cs b/src/NSubstitute/Internal/Core/Arguments/ArgumentSpecification.cs
similarity index 96%
rename from src/NSubstitute/Core/Arguments/ArgumentSpecification.cs
rename to src/NSubstitute/Internal/Core/Arguments/ArgumentSpecification.cs
index a4fc82ec..fca84e23 100644
--- a/src/NSubstitute/Core/Arguments/ArgumentSpecification.cs
+++ b/src/NSubstitute/Internal/Core/Arguments/ArgumentSpecification.cs
@@ -1,4 +1,7 @@
-namespace NSubstitute.Core.Arguments;
+using NSubstitute.Core;
+using NSubstitute.Core.Arguments;
+
+namespace NSubstitute.Internal.Core.Arguments;
public class ArgumentSpecification(Type forType, IArgumentMatcher matcher, Action