Skip to content

Commit

Permalink
Merge pull request #18 from quetzalcoatl/cleanup-001-mock-typeparams
Browse files Browse the repository at this point in the history
Made methods receiving the T of the mock, strong typed to Mock<T>
  • Loading branch information
kzu committed Jun 25, 2012
2 parents e614ae5 + 8c0089d commit de90fd3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Source/Mock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,11 @@ public void VerifyAll()
}

internal static void Verify<T>(
Mock mock,
Mock<T> mock,
Expression<Action<T>> expression,
Times times,
string failMessage)
where T : class
{
Guard.NotNull(() => times, times);

Expand All @@ -263,7 +264,7 @@ internal static void Verify<T>(
}

internal static void Verify<T, TResult>(
Mock mock,
Mock<T> mock,
Expression<Func<T, TResult>> expression,
Times times,
string failMessage)
Expand Down Expand Up @@ -291,7 +292,7 @@ internal static void Verify<T, TResult>(
}

internal static void VerifyGet<T, TProperty>(
Mock mock,
Mock<T> mock,
Expression<Func<T, TProperty>> expression,
Times times,
string failMessage)
Expand Down Expand Up @@ -408,7 +409,7 @@ private static string FormatInvocations(IEnumerable<ICallContext> invocations)

#region Setup

internal static MethodCall<T> Setup<T>(Mock mock, Expression<Action<T>> expression, Func<bool> condition)
internal static MethodCall<T> Setup<T>(Mock<T> mock, Expression<Action<T>> expression, Func<bool> condition)
where T : class
{
return PexProtector.Invoke(() =>
Expand All @@ -430,7 +431,7 @@ internal static MethodCall<T> Setup<T>(Mock mock, Expression<Action<T>> expressi
}

internal static MethodCallReturn<T, TResult> Setup<T, TResult>(
Mock mock,
Mock<T> mock,
Expression<Func<T, TResult>> expression,
Func<bool> condition)
where T : class
Expand Down Expand Up @@ -459,7 +460,7 @@ internal static MethodCallReturn<T, TResult> Setup<T, TResult>(
}

internal static MethodCallReturn<T, TProperty> SetupGet<T, TProperty>(
Mock mock,
Mock<T> mock,
Expression<Func<T, TProperty>> expression,
Func<bool> condition)
where T : class
Expand Down Expand Up @@ -526,7 +527,7 @@ internal static MethodCall<T> SetupSet<T>(Mock<T> mock, Action<T> setterExpressi
}

internal static SetterMethodCall<T, TProperty> SetupSet<T, TProperty>(
Mock mock,
Mock<T> mock,
Expression<Func<T, TProperty>> expression)
where T : class
{
Expand Down

0 comments on commit de90fd3

Please sign in to comment.