Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Source/Mockolate/It.Is.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand Down Expand Up @@ -63,7 +64,7 @@ protected override bool Matches(T value)
}

/// <inheritdoc cref="object.ToString()" />
public override string? ToString()
public override string ToString()
{
if (_comparer is not null)
{
Expand All @@ -80,4 +81,5 @@ private sealed class PredicateParameterMatch<T>(Func<T, bool> predicate, string
public override string ToString() => $"It.Is<{typeof(T).FormatType()}>({predicateExpression})";
}
}
#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsAny.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand All @@ -21,4 +22,5 @@ private sealed class AnyParameterMatch<T> : TypedMatch<T>
public override string ToString() => $"It.IsAny<{typeof(T).FormatType()}>()";
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsFalse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand All @@ -19,4 +20,5 @@ private sealed class FalseParameterMatch : TypedMatch<bool>
public override string ToString() => "It.IsFalse()";
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
3 changes: 3 additions & 0 deletions Source/Mockolate/It.IsInRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand Down Expand Up @@ -49,6 +50,7 @@ public InRangeMatch(T minimum, T maximum, string minimumExpression, string maxim
if (minimum.CompareTo(maximum) > 0)
{
throw new ArgumentOutOfRangeException(nameof(maximum),
// ReSharper disable once LocalizableElement
"The maximum value must be greater than or equal to the minimum value.");
}

Expand Down Expand Up @@ -88,4 +90,5 @@ public override string ToString() => _includeBounds
: $"It.IsInRange({_minimumExpression}, {_maximumExpression}).Exclusive()";
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsNull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand All @@ -20,4 +21,5 @@ private sealed class NullParameterMatch<T> : TypedMatch<T>
public override string ToString() => $"It.IsNull<{typeof(T).FormatType()}>()";
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsOut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand Down Expand Up @@ -107,4 +108,5 @@ public void InvokeCallbacks(object? value)
}
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsReadOnlySpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand All @@ -32,5 +33,6 @@ protected override bool Matches(ReadOnlySpanWrapper<T> value)
=> predicate?.Invoke(value.ReadOnlySpanValues) ?? true;
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
#endif
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand Down Expand Up @@ -166,4 +167,5 @@ public IRefParameter<T> Do(Action<T> callback)
protected abstract bool Matches(T value);
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsSpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand All @@ -32,5 +33,6 @@ protected override bool Matches(SpanWrapper<T> value)
=> predicate?.Invoke(value.SpanValues) ?? true;
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
#endif
2 changes: 2 additions & 0 deletions Source/Mockolate/It.IsTrue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand All @@ -19,4 +20,5 @@ private sealed class TrueParameterMatch : TypedMatch<bool>
public override string ToString() => "It.IsTrue()";
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.Matches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
public partial class It
{
/// <summary>
Expand Down Expand Up @@ -88,4 +89,5 @@ private static string WildcardToRegularExpression(string value)
}
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
2 changes: 2 additions & 0 deletions Source/Mockolate/It.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Mockolate;

#pragma warning disable S3453 // This class can't be instantiated; make its constructor 'public'.
#pragma warning disable S3218 // Inner class members should not shadow outer class "static" or type members
/// <summary>
/// Specify a matching condition for a parameter.
/// </summary>
Expand Down Expand Up @@ -78,4 +79,5 @@ public IParameter<T> Do(Action<T> callback)
protected abstract bool Matches(T value);
}
}
#pragma warning restore S3218 // Inner class members should not shadow outer class "static" or type members
#pragma warning restore S3453 // This class can't be instantiated; make its constructor 'public'.
Loading