@@ -161,58 +161,36 @@ public Task<VerifyResult> VerifyCombinations(
161161 return Verify ( target ) ;
162162 }
163163
164- static Dictionary < StringBuilder , object ? > GetCombinationString (
164+ static List < CombinationResult > GetCombinationString (
165165 Func < object ? [ ] , object ? > processCall ,
166166 List < IEnumerable < object ? > > lists )
167167 {
168- var items = new Dictionary < StringBuilder , object ? > ( ) ;
168+ var items = new List < CombinationResult > ( ) ;
169169 var listCopy = lists . Select ( _ => _ . ToList ( ) ) . ToList ( ) ;
170170 var combinationGenerator = new CombinationGenerator (
171171 listCopy ,
172172 combo =>
173173 {
174+ var keys = combo . ToArray ( ) ;
174175 object ? value ;
175176 try
176177 {
177178 value = processCall ( combo ) ;
178179 }
179180 catch ( TargetInvocationException exception )
180181 {
181- value = ExceptionToString ( exception . InnerException ! ) ;
182+ items . Add ( new ( keys , exception . InnerException ! ) ) ;
183+ return ;
182184 }
183185 catch ( Exception exception )
184186 {
185- value = ExceptionToString ( exception ) ;
187+ items . Add ( new ( keys , exception ) ) ;
188+ return ;
186189 }
187- items . Add ( BuildKeys ( combo ) , value ) ;
190+
191+ items . Add ( new ( keys , value ) ) ;
188192 } ) ;
189193 combinationGenerator . Run ( ) ;
190194 return items ;
191195 }
192-
193- static string ExceptionToString ( Exception exception ) =>
194- $ "{ exception . GetType ( ) . Name } : { exception . Message } ";
195-
196- static StringBuilder BuildKeys ( object ? [ ] combo )
197- {
198- var builder = new StringBuilder ( ) ;
199- for ( var index = 0 ; index < combo . Length ; index ++ )
200- {
201- var item = combo [ index ] ;
202- VerifierSettings . AppendParameter ( item , builder , true ) ;
203- if ( index + 1 != combo . Length )
204- {
205- builder . Append ( ", " ) ;
206- }
207- }
208-
209- return builder ;
210- }
211-
212- public class Item ( StringBuilder keys , object ? value )
213- {
214- public StringBuilder Keys { get ; } = keys ;
215- public object ? Value { get ; } = value ;
216- }
217- }
218-
196+ }
0 commit comments