@@ -36,14 +36,7 @@ public void TestDefault()
36
36
}
37
37
38
38
[ Fact ]
39
- public void TestParameterSkipped_All ( )
40
- {
41
- ExecuteBuild ( skippedTargets : new ExecutableTarget [ 0 ] ) ;
42
- AssertSkipped ( A , B , C ) ;
43
- }
44
-
45
- [ Fact ]
46
- public void TestParameterSkipped_Single ( )
39
+ public void TestParameterSkipped ( )
47
40
{
48
41
ExecuteBuild ( skippedTargets : new [ ] { A } ) ;
49
42
AssertSucceeded ( B , C ) ;
@@ -52,9 +45,21 @@ public void TestParameterSkipped_Single()
52
45
}
53
46
54
47
[ Fact ]
55
- public void TestParameterSkipped_Multiple ( )
48
+ public void TestParameterSkipped_Default ( )
49
+ {
50
+ C . IsDefault = true ;
51
+ C . Invoked = false ;
52
+
53
+ ExecuteBuild ( skippedTargets : new ExecutableTarget [ 0 ] ) ;
54
+ AssertSkipped ( A , B , C ) ;
55
+ }
56
+
57
+ [ Fact ]
58
+ public void TestParameterSkipped_Invoked ( )
56
59
{
57
- ExecuteBuild ( skippedTargets : new [ ] { A , B } ) ;
60
+ C . Invoked = true ;
61
+
62
+ ExecuteBuild ( skippedTargets : new ExecutableTarget [ 0 ] ) ;
58
63
AssertSucceeded ( C ) ;
59
64
AssertSkipped ( A , B ) ;
60
65
}
@@ -66,6 +71,7 @@ public void TestParameterSkipped_DependencyBehavior_Skip()
66
71
ExecuteBuild ( skippedTargets : new [ ] { B } ) ;
67
72
AssertSucceeded ( C ) ;
68
73
AssertSkipped ( A , B ) ;
74
+ A . Skipped . Should ( ) . Be ( "because of B" ) ;
69
75
}
70
76
71
77
[ Fact ]
@@ -109,6 +115,16 @@ public void TestStaticCondition_Multiple()
109
115
A . OnlyWhen . Should ( ) . Be ( "A && B" ) ;
110
116
}
111
117
118
+ [ Fact ]
119
+ public void TestStaticCondition_Throwing ( )
120
+ {
121
+ A . StaticConditions . Add ( ( "condition" , ( ) => throw new Exception ( ) ) ) ;
122
+ var action = ( ) => ExecuteBuild ( ) ;
123
+
124
+ action . Should ( ) . Throw < TargetExecutionException > ( )
125
+ . WithMessage ( "Target 'A' has thrown an exception." ) ;
126
+ }
127
+
112
128
[ Fact ]
113
129
public void TestDynamicCondition_Unchanged ( )
114
130
{
@@ -130,6 +146,16 @@ public void TestDynamicCondition_Changed()
130
146
AssertSucceeded ( A , B , C ) ;
131
147
}
132
148
149
+ [ Fact ]
150
+ public void TestDynamicCondition_Throwing ( )
151
+ {
152
+ B . DynamicConditions . Add ( ( "condition" , ( ) => throw new Exception ( ) ) ) ;
153
+ var action = ( ) => ExecuteBuild ( ) ;
154
+
155
+ action . Should ( ) . Throw < TargetExecutionException > ( )
156
+ . WithMessage ( "Target 'B' has thrown an exception." ) ;
157
+ }
158
+
133
159
[ Fact ]
134
160
public void TestMixedConditions ( )
135
161
{
@@ -140,22 +166,13 @@ public void TestMixedConditions()
140
166
}
141
167
142
168
[ Fact ]
143
- public void TestThrowingCondition ( )
144
- {
145
- A . StaticConditions . Add ( ( "condition" , ( ) => throw new Exception ( ) ) ) ;
146
- var action = ( ) => ExecuteBuild ( ) ;
147
-
148
- action . Should ( ) . Throw < TargetExecutionException > ( ) ;
149
- }
150
-
151
- [ Fact ]
152
- public void TestSkipTriggers ( )
169
+ public void TestTriggers_Skipped ( )
153
170
{
171
+ B . ExecutionDependencies . Clear ( ) ;
172
+ C . ExecutionDependencies . Clear ( ) ;
154
173
A . DynamicConditions . Add ( ( "condition" , ( ) => false ) ) ;
155
174
A . Triggers . Add ( B ) ;
156
175
B . Triggers . Add ( C ) ;
157
- B . ExecutionDependencies . Clear ( ) ;
158
- C . ExecutionDependencies . Clear ( ) ;
159
176
160
177
ExecuteBuild ( ) ;
161
178
0 commit comments