Skip to content

Commit f25f2c5

Browse files
Tidy-up formatting
Tidy up formatting of parameters.
1 parent 1a7cee9 commit f25f2c5

File tree

3 files changed

+45
-22
lines changed

3 files changed

+45
-22
lines changed

test/Polly.Specs/Helpers/ContextualPolicyTResultExtensions.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
public static class ContextualPolicyTResultExtensions
44
{
5-
public static TResult RaiseResultSequence<TResult>(this Policy<TResult> policy,
5+
public static TResult RaiseResultSequence<TResult>(
6+
this Policy<TResult> policy,
67
IDictionary<string, object> contextData,
78
params TResult[] resultsToRaise) =>
89
policy.RaiseResultSequence(contextData, resultsToRaise.ToList());
910

10-
public static TResult RaiseResultSequence<TResult>(this Policy<TResult> policy,
11+
public static TResult RaiseResultSequence<TResult>(
12+
this Policy<TResult> policy,
1113
IDictionary<string, object> contextData,
1214
IEnumerable<TResult> resultsToRaise)
1315
{
@@ -24,12 +26,14 @@ public static TResult RaiseResultSequence<TResult>(this Policy<TResult> policy,
2426
}, contextData);
2527
}
2628

27-
public static PolicyResult<TResult> RaiseResultSequenceOnExecuteAndCapture<TResult>(this Policy<TResult> policy,
28-
IDictionary<string, object> contextData,
29-
params TResult[] resultsToRaise) =>
29+
public static PolicyResult<TResult> RaiseResultSequenceOnExecuteAndCapture<TResult>(
30+
this Policy<TResult> policy,
31+
IDictionary<string, object> contextData,
32+
params TResult[] resultsToRaise) =>
3033
policy.RaiseResultSequenceOnExecuteAndCapture(contextData, resultsToRaise.ToList());
3134

32-
public static PolicyResult<TResult> RaiseResultSequenceOnExecuteAndCapture<TResult>(this Policy<TResult> policy,
35+
public static PolicyResult<TResult> RaiseResultSequenceOnExecuteAndCapture<TResult>(
36+
this Policy<TResult> policy,
3337
IDictionary<string, object> contextData,
3438
IEnumerable<TResult> resultsToRaise)
3539
{

test/Polly.Specs/Helpers/PolicyTResultExtensions.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public static TResult RaiseResultSequence<TResult>(this Policy<TResult> policy,
2424
public static TResult RaiseResultAndOrExceptionSequence<TResult>(this Policy<TResult> policy, params object[] resultsOrExceptionsToRaise) =>
2525
policy.RaiseResultAndOrExceptionSequence(resultsOrExceptionsToRaise.ToList());
2626

27-
public static TResult RaiseResultAndOrExceptionSequence<TResult>(this Policy<TResult> policy,
28-
IEnumerable<object> resultsOrExceptionsToRaise)
27+
public static TResult RaiseResultAndOrExceptionSequence<TResult>(this Policy<TResult> policy, IEnumerable<object> resultsOrExceptionsToRaise)
2928
{
3029
using var enumerator = resultsOrExceptionsToRaise.GetEnumerator();
3130
return policy.Execute(() =>
@@ -58,13 +57,24 @@ public class ResultAndOrCancellationScenario
5857
public bool ActionObservesCancellation = true;
5958
}
6059

61-
public static TResult RaiseResultSequenceAndOrCancellation<TResult>(this Policy<TResult> policy,
62-
Scenario scenario, CancellationTokenSource cancellationTokenSource, Action onExecute,
60+
public static TResult RaiseResultSequenceAndOrCancellation<TResult>(
61+
this Policy<TResult> policy,
62+
Scenario scenario,
63+
CancellationTokenSource cancellationTokenSource,
64+
Action onExecute,
6365
params TResult[] resultsToRaise) =>
64-
policy.RaiseResultSequenceAndOrCancellation(scenario, cancellationTokenSource, onExecute,
66+
policy.RaiseResultSequenceAndOrCancellation(
67+
scenario,
68+
cancellationTokenSource,
69+
onExecute,
6570
resultsToRaise.ToList());
6671

67-
public static TResult RaiseResultSequenceAndOrCancellation<TResult>(this Policy<TResult> policy, Scenario scenario, CancellationTokenSource cancellationTokenSource, Action onExecute, IEnumerable<TResult> resultsToRaise)
72+
public static TResult RaiseResultSequenceAndOrCancellation<TResult>(
73+
this Policy<TResult> policy,
74+
Scenario scenario,
75+
CancellationTokenSource cancellationTokenSource,
76+
Action onExecute,
77+
IEnumerable<TResult> resultsToRaise)
6878
{
6979
int counter = 0;
7080

test/Polly.Specs/Helpers/PolicyTResultExtensionsAsync.cs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ public static Task<TResult> RaiseResultSequenceAsync<TResult>(this AsyncPolicy<T
1010
public static Task<TResult> RaiseResultSequenceAsync<TResult>(this AsyncPolicy<TResult> policy, IEnumerable<TResult> resultsToRaise) =>
1111
policy.RaiseResultSequenceAsync(default, resultsToRaise);
1212

13-
public static async Task<TResult> RaiseResultSequenceAsync<TResult>(this AsyncPolicy<TResult> policy,
14-
CancellationToken cancellationToken, IEnumerable<TResult> resultsToRaise)
13+
public static async Task<TResult> RaiseResultSequenceAsync<TResult>(
14+
this AsyncPolicy<TResult> policy,
15+
CancellationToken cancellationToken,
16+
IEnumerable<TResult> resultsToRaise)
1517
{
1618
using var enumerator = resultsToRaise.GetEnumerator();
1719
return await policy.ExecuteAsync(_ =>
@@ -28,12 +30,13 @@ public static async Task<TResult> RaiseResultSequenceAsync<TResult>(this AsyncPo
2830
public static Task<TResult> RaiseResultAndOrExceptionSequenceAsync<TResult>(this AsyncPolicy<TResult> policy, params object[] resultsOrExceptionsToRaise) =>
2931
policy.RaiseResultAndOrExceptionSequenceAsync(resultsOrExceptionsToRaise.ToList());
3032

31-
public static Task<TResult> RaiseResultAndOrExceptionSequenceAsync<TResult>(this AsyncPolicy<TResult> policy,
32-
IEnumerable<object> resultsOrExceptionsToRaise) =>
33+
public static Task<TResult> RaiseResultAndOrExceptionSequenceAsync<TResult>(this AsyncPolicy<TResult> policy, IEnumerable<object> resultsOrExceptionsToRaise) =>
3334
policy.RaiseResultAndOrExceptionSequenceAsync(CancellationToken.None, resultsOrExceptionsToRaise);
3435

35-
public static async Task<TResult> RaiseResultAndOrExceptionSequenceAsync<TResult>(this AsyncPolicy<TResult> policy,
36-
CancellationToken cancellationToken, IEnumerable<object> resultsOrExceptionsToRaise)
36+
public static async Task<TResult> RaiseResultAndOrExceptionSequenceAsync<TResult>(
37+
this AsyncPolicy<TResult> policy,
38+
CancellationToken cancellationToken,
39+
IEnumerable<object> resultsOrExceptionsToRaise)
3740
{
3841
using var enumerator = resultsOrExceptionsToRaise.GetEnumerator();
3942
return await policy.ExecuteAsync(_ =>
@@ -67,15 +70,21 @@ public class ResultAndOrCancellationScenario
6770
public bool ActionObservesCancellation = true;
6871
}
6972

70-
public static Task<TResult> RaiseResultSequenceAndOrCancellationAsync<TResult>(this AsyncPolicy<TResult> policy,
71-
Scenario scenario, CancellationTokenSource cancellationTokenSource, Action onExecute,
73+
public static Task<TResult> RaiseResultSequenceAndOrCancellationAsync<TResult>(
74+
this AsyncPolicy<TResult> policy,
75+
Scenario scenario,
76+
CancellationTokenSource cancellationTokenSource,
77+
Action onExecute,
7278
params TResult[] resultsToRaise) =>
7379
policy.RaiseResultSequenceAndOrCancellationAsync(scenario, cancellationTokenSource, onExecute,
7480
resultsToRaise.ToList());
7581

7682
public static async Task<TResult> RaiseResultSequenceAndOrCancellationAsync<TResult>(
77-
this AsyncPolicy<TResult> policy, Scenario scenario, CancellationTokenSource cancellationTokenSource,
78-
Action onExecute, IEnumerable<TResult> resultsToRaise)
83+
this AsyncPolicy<TResult> policy,
84+
Scenario scenario,
85+
CancellationTokenSource cancellationTokenSource,
86+
Action onExecute,
87+
IEnumerable<TResult> resultsToRaise)
7988
{
8089
int counter = 0;
8190

0 commit comments

Comments
 (0)