@@ -21,42 +21,6 @@ namespace Nuke.Common;
2121[ DebuggerStepThrough ]
2222public static class ControlFlow
2323{
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-
6024 public static void SuppressErrors ( Action action , bool includeStackTrace = false , bool logWarning = true )
6125 {
6226 SuppressErrorsIf ( condition : true , action , includeStackTrace : includeStackTrace , logWarning : logWarning ) ;
@@ -106,7 +70,7 @@ public static void ExecuteWithRetry(
10670 TimeSpan ? delay = null ,
10771 Action < string > logAction = null )
10872 {
109- Assert ( retryAttempts > 0 , "retryAttempts > 0" ) ;
73+ Assert . True ( retryAttempts > 0 ) ;
11074
11175 logAction ??= Log . Warning ;
11276 Exception lastException = null ;
@@ -138,7 +102,7 @@ public static void ExecuteWithRetry(
138102 }
139103 }
140104
141- Fail ( new [ ]
105+ Assert . Fail ( new [ ]
142106 {
143107 $ "Execution failed permanently after { retryAttempts } attempts.",
144108 $ "Last attempt failed with: { lastException ! . Message } "
0 commit comments