Skip to content

Commit

Permalink
remove some redundant internal
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Oct 20, 2023
1 parent dfdaf09 commit 77ef057
Show file tree
Hide file tree
Showing 77 changed files with 79 additions and 79 deletions.
4 changes: 2 additions & 2 deletions src/Shouldly.Tests/TestHelpers/CustomComparerClass.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.Tests.TestHelpers;

internal class CustomComparer<T> : IComparer<T>
class CustomComparer<T> : IComparer<T>
{
public int Compare(T? x, T? y)
{
Expand All @@ -12,7 +12,7 @@ public int Compare(T? x, T? y)
}
}

internal class Custom
class Custom
{
public int Val { get; set; }
}
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/MyBase.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Shouldly.Tests.TestHelpers;

internal class MyBase { }
class MyBase { }
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/MyDecoratedBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Shouldly.Tests.TestHelpers;

[UseCulture("en-AU")]
internal class MyDecoratedBase { }
class MyDecoratedBase { }
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/MyDecoratedThing.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Shouldly.Tests.TestHelpers;

internal class MyDecoratedThing : MyDecoratedBase { }
class MyDecoratedThing : MyDecoratedBase { }
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/MyThing.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
namespace Shouldly.Tests.TestHelpers;

internal class MyThing : MyBase { }
class MyThing : MyBase { }
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/SomeFlags.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Shouldly.Tests.TestHelpers;

[Flags]
internal enum SomeFlags
enum SomeFlags
{
Val1,
Val2,
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/Strange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.Tests.TestHelpers;

internal class Strange : IEnumerable<Strange>
class Strange : IEnumerable<Strange>
{
private readonly string? _thing;

Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/TestHelpers/UncomparableClass.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.Tests.TestHelpers;

internal class UncomparableClass
class UncomparableClass
{
private readonly string _description;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// ReSharper disable CheckNamespace
namespace ExpressionToString;

internal class ExpressionStringBuilder : ExpressionVisitor
class ExpressionStringBuilder : ExpressionVisitor
{
// ReSharper disable InconsistentNaming
private readonly StringBuilder builder = new();
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/CallContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly;

internal static class CallContext
static class CallContext
{
private static readonly ConcurrentDictionary<string, AsyncLocal<object?>> state = new();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.DifferenceHighlighting;

internal static class DifferenceHighlighter
static class DifferenceHighlighter
{
private static readonly List<IDifferenceHighlighter> _differenceHighlighters = new()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.DifferenceHighlighting;

internal class DifferenceIndexConsolidator
class DifferenceIndexConsolidator
{
private readonly int _maxDiffLength;
private readonly int _maxLengthOfStrings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Shouldly.DifferenceHighlighting;
/// Highlights differences between IEnumerables of the same type,
/// marking differences with asterisks
/// </summary>
internal class EnumerableDifferenceHighlighter : IDifferenceHighlighter
class EnumerableDifferenceHighlighter : IDifferenceHighlighter
{
private const int MaxElementsToShow = 1000;
private readonly ItemDifferenceHighlighter _itemDifferenceHighlighter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.DifferenceHighlighting;

internal class FormattedDetailedDifferenceString
class FormattedDetailedDifferenceString
{
private readonly string _actualValue;
private readonly string _expectedValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Shouldly.DifferenceHighlighting;
/// <summary>
/// Interface for classes which can highlight differences in things
/// </summary>
internal interface IDifferenceHighlighter
interface IDifferenceHighlighter
{
bool CanProcess(IShouldlyAssertionContext context);
string? HighlightDifferences(IShouldlyAssertionContext context);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.DifferenceHighlighting;

internal interface IStringDifferenceHighlighter
interface IStringDifferenceHighlighter
{
string? HighlightDifferences(string? expected, string? actual);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.DifferenceHighlighting;

internal class ItemDifferenceHighlighter
class ItemDifferenceHighlighter
{
public const string HighlightCharacter = "*";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.DifferenceHighlighting;

internal class StringDifferenceHighlighter : IStringDifferenceHighlighter
class StringDifferenceHighlighter : IStringDifferenceHighlighter
{
private const int maxDiffLength = 21;
private const int maxNumberOfDiffs = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Shouldly.Internals.AssertionFactories;

internal static class StringShouldBeAssertionFactory
static class StringShouldBeAssertionFactory
{
public static IAssertion Create(string? expected, string? actual, StringCompareShould options, [CallerMemberName] string shouldlyMethod = null!)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/Assertions/IAssertion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.Internals.Assertions;

internal interface IAssertion
interface IAssertion
{
bool IsSatisfied();
string? GenerateMessage(string? customMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.Internals.Assertions;

internal class StringShouldBeAssertion : IAssertion
class StringShouldBeAssertion : IAssertion
{
private readonly string? _expected;
private readonly string? _actual;
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/DeterministicBuildHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.Internals;

internal static class DeterministicBuildHelpers
static class DeterministicBuildHelpers
{
private static readonly Regex DeterministicPathRegex = new(@"^/_\d*/");

Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.Internals;

internal static class EnumerableExtensions
static class EnumerableExtensions
{
public static IEnumerable<(int Index, T Value)> AsIndexed<T>(this IEnumerable<T> source)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Shouldly/Internals/EnumerableProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Shouldly.Internals;

internal interface IEnumerableProxy
interface IEnumerableProxy
{
object ProxiedValue { get; }
}

internal sealed class EnumerableProxy<T> : IEnumerable<T>, IEnumerableProxy
sealed class EnumerableProxy<T> : IEnumerable<T>, IEnumerableProxy
{
public static IEnumerable<T>? WrapNonCollection(IEnumerable<T>? baseEnum)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/EqualityComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Shouldly;
* Code heavily influenced by code from xunit assert equality comparer
* at https://github.com/xunit/xunit/blob/master/src/xunit2.assert/Asserts/Sdk/AssertEqualityComparer.cs
*/
internal class EqualityComparer<T> : IEqualityComparer<T>
class EqualityComparer<T> : IEqualityComparer<T>
{
private static readonly IEqualityComparer DefaultInnerComparer = new EqualityComparerAdapter(new EqualityComparer<object>());

Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/EqualityComparerAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Shouldly;
* Code heavily influenced by code from xunit assert equality comparer adapter
* at https://github.com/xunit/xunit/blob/master/src/xunit2.assert/Asserts/Sdk/AssertEqualityComparerAdapter.cs
*/
internal class EqualityComparerAdapter : IEqualityComparer
class EqualityComparerAdapter : IEqualityComparer
{
private readonly IEqualityComparer<object> _innerComparer;

Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/FloatingPointNumerics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace NUnit.Framework.Constraints;
/// as low as 0.0000001 for small numbers or as high as 10.0 for large numbers.
/// </para>
/// </remarks>
internal static class FloatingPointNumerics
static class FloatingPointNumerics
{
/// <summary>Compares two floating point values for equality</summary>
/// <param name="left">First floating point value to be compared</param>
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/ICodeTextGetter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Shouldly.Internals;

internal interface ICodeTextGetter
interface ICodeTextGetter
{
string? GetCodeText(object? actual, System.Diagnostics.StackTrace? stackTrace = null);
}
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/Is.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Shouldly;

internal static class Is
static class Is
{
public static bool InRange<T>([DisallowNull] T comparable, T? from, T? to)
where T : IComparable<T>
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/Numerics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace NUnit.Framework.Constraints;
/// <summary>
/// The Numerics class contains common operations on numeric values.
/// </summary>
internal static class Numerics
static class Numerics
{
/// <summary>
/// Checks the type of the object, returning true if
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/ObjectEqualityComparer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Shouldly;

[Serializable]
internal class ObjectEqualityComparer<T> : System.Collections.Generic.EqualityComparer<T>
class ObjectEqualityComparer<T> : System.Collections.Generic.EqualityComparer<T>
{
public override bool Equals(T? x, T? y)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/ShouldThrowAssertionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Shouldly;

internal class ShouldThrowAssertionContext : ShouldlyAssertionContext
class ShouldThrowAssertionContext : ShouldlyAssertionContext
{
public string? ExceptionMessage { get; }

Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/SourceCodeTextGetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.Internals;

internal class ActualCodeTextGetter : ICodeTextGetter
class ActualCodeTextGetter : ICodeTextGetter
{
private bool _determinedOriginatingFrame;
private string? _shouldMethod;
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/StackTraceHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Shouldly.Internals;

internal static class StackTraceHelpers
static class StackTraceHelpers
{
public static string GetStackTrace(Exception exception, [NotNull] ref string? cachedValue)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/StringHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Shouldly;

internal static class StringHelpers
static class StringHelpers
{
internal static string? ToStringAwesomely(this object? value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/TaskExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Shouldly;

// http://blogs.msdn.com/b/pfxteam/archive/2011/11/10/10235834.aspx
internal static class TaskExtensions
static class TaskExtensions
{
private struct VoidTypeStruct { }

Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/Tolerance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// type that supports taking a difference between two
/// objects and comparing that difference to a value.
/// </summary>
internal class Tolerance
class Tolerance
{
private const string ModeMustFollowTolerance = "Tolerance amount must be specified before setting mode";
private const string MultipleToleranceModes = "Tried to use multiple tolerance modes at the same time";
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/ToleranceMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// Modes in which the tolerance value for a comparison can be interpreted.
/// </summary>
internal enum ToleranceMode
enum ToleranceMode
{
/// <summary>
/// The tolerance was created with a value, without specifying
Expand Down
2 changes: 1 addition & 1 deletion src/Shouldly/Internals/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Shouldly;

internal static class TypeExtensions
static class TypeExtensions
{
public static bool IsValueType(this Type type) =>
type.GetTypeInfo().IsValueType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Shouldly.MessageGenerators;

internal class DictionaryShouldContainKeyAndValueMessageGenerator : ShouldlyMessageGenerator
class DictionaryShouldContainKeyAndValueMessageGenerator : ShouldlyMessageGenerator
{
private static readonly Regex Validator = new("ShouldContainKeyAndValue");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Shouldly.MessageGenerators;

internal class DictionaryShouldNotContainValueForKeyMessageGenerator : ShouldlyMessageGenerator
class DictionaryShouldNotContainValueForKeyMessageGenerator : ShouldlyMessageGenerator
{
private static readonly Regex Validator = new("ShouldNotContainValueForKey");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Shouldly.MessageGenerators;

internal class DictionaryShouldOrNotContainKeyMessageGenerator : ShouldlyMessageGenerator
class DictionaryShouldOrNotContainKeyMessageGenerator : ShouldlyMessageGenerator
{
private static readonly Regex Validator = new("Should(Not)?ContainKey");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Shouldly.MessageGenerators;

internal class DynamicShouldMessageGenerator : ShouldlyMessageGenerator
class DynamicShouldMessageGenerator : ShouldlyMessageGenerator
{
private static readonly Regex Validator = new("HaveProperty", RegexOptions.Compiled);
private static readonly Regex DynamicObjectNameExtractor = new(@"DynamicShould.HaveProperty\((?<dynamicObjectName>.*?),(?<propertyName>.*?)[\),]", RegexOptions.Compiled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Shouldly.MessageGenerators;

internal class ShouldAllBeMessageGenerator : ShouldlyMessageGenerator
class ShouldAllBeMessageGenerator : ShouldlyMessageGenerator
{
private static readonly Regex Validator = new("ShouldAllBe");

Expand Down

0 comments on commit 77ef057

Please sign in to comment.