Skip to content

Commit f47c1be

Browse files
andrewimcclementkzu
authored andcommitted
Tidy nullability in Mock.cs.
1 parent c4ff1b5 commit f47c1be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Moq/Mock.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public static void VerifyAll(params Mock[] mocks)
151151
/// </summary>
152152
public abstract bool CallBase { get; set; }
153153

154-
internal abstract object[] ConstructorArguments { get; }
154+
internal abstract object?[] ConstructorArguments { get; }
155155

156156
/// <summary>
157157
/// Specifies the behavior to use when returning default values for unexpected invocations on loose mocks.
@@ -397,7 +397,7 @@ static void VerifyNoOtherCalls(Mock mock, HashSet<Mock> verifiedMocks)
397397
// In order for an invocation to be "transitive", its return value has to be a
398398
// sub-object (inner mock); and that sub-object has to have received at least
399399
// one call:
400-
var wasTransitiveInvocation = mock.MutableSetups.FindLastInnerMock(setup => setup.Matches(unverifiedInvocations[i])) is Mock innerMock
400+
var wasTransitiveInvocation = mock.MutableSetups.FindLastInnerMock(setup => setup.Matches(unverifiedInvocations[i]!)) is Mock innerMock
401401
&& innerMock.MutableInvocations.Any();
402402
if (wasTransitiveInvocation)
403403
{
@@ -518,7 +518,7 @@ internal static MethodCall SetupGet(Mock mock, LambdaExpression expression, Cond
518518
return Mock.Setup(mock, expression, condition);
519519
}
520520

521-
internal static MethodCall SetupSet(Mock mock, LambdaExpression expression, Condition condition)
521+
internal static MethodCall SetupSet(Mock mock, LambdaExpression expression, Condition? condition)
522522
{
523523
Guard.NotNull(expression, nameof(expression));
524524
Guard.IsAssignmentToPropertyOrIndexer(expression, nameof(expression));
@@ -583,15 +583,15 @@ internal static bool SetupReturns(Mock mock, LambdaExpression expression, object
583583
return true;
584584
}
585585

586-
internal static MethodCall SetupAdd(Mock mock, LambdaExpression expression, Condition condition)
586+
internal static MethodCall SetupAdd(Mock mock, LambdaExpression expression, Condition? condition)
587587
{
588588
Guard.NotNull(expression, nameof(expression));
589589
Guard.IsEventAdd(expression, nameof(expression));
590590

591591
return Mock.Setup(mock, expression, condition);
592592
}
593593

594-
internal static MethodCall SetupRemove(Mock mock, LambdaExpression expression, Condition condition)
594+
internal static MethodCall SetupRemove(Mock mock, LambdaExpression expression, Condition? condition)
595595
{
596596
Guard.NotNull(expression, nameof(expression));
597597
Guard.IsEventRemove(expression, nameof(expression));
@@ -611,7 +611,7 @@ internal static SequenceSetup SetupSequence(Mock mock, LambdaExpression expressi
611611
});
612612
}
613613

614-
internal static StubbedPropertySetup SetupProperty(Mock mock, LambdaExpression expression, object initialValue)
614+
internal static StubbedPropertySetup SetupProperty(Mock mock, LambdaExpression expression, object? initialValue)
615615
{
616616
Guard.NotNull(expression, nameof(expression));
617617

0 commit comments

Comments
 (0)