@@ -21,42 +21,6 @@ namespace Nuke.Common;
21
21
[ DebuggerStepThrough ]
22
22
public static class ControlFlow
23
23
{
24
- [ Obsolete ( "Use " + nameof ( Common . Assert ) + "." + nameof ( Common . Assert . Fail ) ) ]
25
- public static void Fail ( string format , params object [ ] args )
26
- {
27
- Fail ( string . Format ( format , args ) ) ;
28
- }
29
-
30
- [ Obsolete ( "Use " + nameof ( Common . Assert ) + "." + nameof ( Common . Assert . Fail ) ) ]
31
- public static void Fail ( object value , Exception exception = null )
32
- {
33
- Fail ( value . ToString ( ) , exception ) ;
34
- }
35
-
36
- [ Obsolete ( "Use " + nameof ( Common . Assert ) + "." + nameof ( Common . Assert . Fail ) ) ]
37
- public static void Fail ( string text , Exception exception = null )
38
- {
39
- Common . Assert . Fail ( text , exception ) ;
40
- }
41
-
42
- [ Obsolete ( "Use " + nameof ( Common . Assert ) + "." + nameof ( Common . Assert . True ) +
43
- " or " + nameof ( Common . Assert ) + "." + nameof ( Common . Assert . False ) ) ]
44
- public static void Assert (
45
- [ AssertionCondition ( AssertionConditionType . IS_TRUE ) ]
46
- bool condition ,
47
- string text )
48
- {
49
- Common . Assert . True ( condition , text ) ;
50
- }
51
-
52
- [ Obsolete ( "Use " + nameof ( Common . Assert ) + "." + nameof ( Common . Assert . NotNullOrEmpty ) ) ]
53
- public static IReadOnlyCollection < T > NotEmpty < T > ( [ CanBeNull ] this IEnumerable < T > enumerable , string message = null )
54
- {
55
- var collection = enumerable . NotNull ( ) . ToList ( ) . AsReadOnly ( ) ;
56
- Common . Assert . NotEmpty ( collection ) ;
57
- return collection ;
58
- }
59
-
60
24
public static void SuppressErrors ( Action action , bool includeStackTrace = false , bool logWarning = true )
61
25
{
62
26
SuppressErrorsIf ( condition : true , action , includeStackTrace : includeStackTrace , logWarning : logWarning ) ;
@@ -106,7 +70,7 @@ public static void ExecuteWithRetry(
106
70
TimeSpan ? delay = null ,
107
71
Action < string > logAction = null )
108
72
{
109
- Assert ( retryAttempts > 0 , "retryAttempts > 0" ) ;
73
+ Assert . True ( retryAttempts > 0 ) ;
110
74
111
75
logAction ??= Log . Warning ;
112
76
Exception lastException = null ;
@@ -138,7 +102,7 @@ public static void ExecuteWithRetry(
138
102
}
139
103
}
140
104
141
- Fail ( new [ ]
105
+ Assert . Fail ( new [ ]
142
106
{
143
107
$ "Execution failed permanently after { retryAttempts } attempts.",
144
108
$ "Last attempt failed with: { lastException ! . Message } "
0 commit comments