@@ -234,7 +234,7 @@ public void PassesIndividualSourceDataAndCombinesSingleSourceControl()
234
234
}
235
235
236
236
[ Test ]
237
- public void MigratesSingleSourceControlDataToNewFormat ( )
237
+ public void MigratesSourceControlDataToNewFormat ( )
238
238
{
239
239
IntegrationResult from = IntegrationResultMother . CreateSuccessful ( DateTime . Now ) ;
240
240
IntegrationResult to = IntegrationResultMother . CreateSuccessful ( DateTime . Now . AddDays ( 10 ) ) ;
@@ -249,7 +249,9 @@ public void MigratesSingleSourceControlDataToNewFormat()
249
249
scList . Add ( mock . MockInstance ) ;
250
250
}
251
251
scList . Add ( new MockSourceControl ( ) ) ;
252
+ scList . Add ( new MockSourceControl ( ) ) ;
252
253
254
+ from . SourceControlData . Add ( new NameValuePair ( "test" , "first" ) ) ;
253
255
from . SourceControlData . Add ( new NameValuePair ( "commit" , "first" ) ) ;
254
256
255
257
MultiSourceControl multiSourceControl = new MultiSourceControl ( ) ;
@@ -259,7 +261,7 @@ public void MigratesSingleSourceControlDataToNewFormat()
259
261
ArrayList returnedMods = new ArrayList ( multiSourceControl . GetModifications ( from , to ) ) ;
260
262
261
263
//// VERIFY
262
- Assert . AreEqual ( 3 , to . SourceControlData . Count , "SourceControlData.Count" ) ;
264
+ Assert . AreEqual ( 4 , to . SourceControlData . Count , "SourceControlData.Count" ) ;
263
265
264
266
List < NameValuePair > list = new List < NameValuePair > ( ) ;
265
267
@@ -269,13 +271,53 @@ public void MigratesSingleSourceControlDataToNewFormat()
269
271
Assert . AreEqual ( XmlConversionUtil . ConvertObjectToXml ( list ) , to . SourceControlData [ 1 ] . Value , "SourceControlData[1].Value" ) ;
270
272
Assert . AreEqual ( "sc1" , to . SourceControlData [ 1 ] . Name , "SourceControlData[1].Name" ) ;
271
273
272
- list . Add ( new NameValuePair ( "commit " , "first" ) ) ;
274
+ list . Add ( new NameValuePair ( "test " , "first" ) ) ;
273
275
Assert . AreEqual ( XmlConversionUtil . ConvertObjectToXml ( list ) , to . SourceControlData [ 2 ] . Value , "SourceControlData[2].Value" ) ;
274
276
list . Clear ( ) ;
275
277
Assert . AreEqual ( "sc2" , to . SourceControlData [ 2 ] . Name , "SourceControlData[2].Name" ) ;
278
+
279
+ list . Add ( new NameValuePair ( "commit" , "first" ) ) ;
280
+ Assert . AreEqual ( XmlConversionUtil . ConvertObjectToXml ( list ) , to . SourceControlData [ 3 ] . Value , "SourceControlData[3].Value" ) ;
281
+ list . Clear ( ) ;
282
+ Assert . AreEqual ( "sc3" , to . SourceControlData [ 3 ] . Name , "SourceControlData[3].Name" ) ;
276
283
}
277
-
278
- [ Test ]
284
+
285
+ [ Test ]
286
+ public void MigratesSourceControlDataToNewFormatSameSourceControlCount ( )
287
+ {
288
+ IntegrationResult from = IntegrationResultMother . CreateSuccessful ( DateTime . Now ) ;
289
+ IntegrationResult to = IntegrationResultMother . CreateSuccessful ( DateTime . Now . AddDays ( 10 ) ) ;
290
+
291
+ ArrayList scList = new ArrayList ( ) ;
292
+ scList . Add ( new MockSourceControl ( ) ) ;
293
+ scList . Add ( new MockSourceControl ( ) ) ;
294
+
295
+ from . SourceControlData . Add ( new NameValuePair ( "test" , "first" ) ) ;
296
+ from . SourceControlData . Add ( new NameValuePair ( "commit" , "first" ) ) ;
297
+
298
+ MultiSourceControl multiSourceControl = new MultiSourceControl ( ) ;
299
+ multiSourceControl . SourceControls = ( ISourceControl [ ] ) scList . ToArray ( typeof ( ISourceControl ) ) ;
300
+
301
+ //// EXECUTE
302
+ ArrayList returnedMods = new ArrayList ( multiSourceControl . GetModifications ( from , to ) ) ;
303
+
304
+ //// VERIFY
305
+ Assert . AreEqual ( 2 , to . SourceControlData . Count , "SourceControlData.Count" ) ;
306
+
307
+ List < NameValuePair > list = new List < NameValuePair > ( ) ;
308
+
309
+ list . Add ( new NameValuePair ( "test" , "first" ) ) ;
310
+ Assert . AreEqual ( XmlConversionUtil . ConvertObjectToXml ( list ) , to . SourceControlData [ 0 ] . Value , "SourceControlData[0].Value" ) ;
311
+ list . Clear ( ) ;
312
+ Assert . AreEqual ( "sc0" , to . SourceControlData [ 0 ] . Name , "SourceControlData[0].Name" ) ;
313
+
314
+ list . Add ( new NameValuePair ( "commit" , "first" ) ) ;
315
+ Assert . AreEqual ( XmlConversionUtil . ConvertObjectToXml ( list ) , to . SourceControlData [ 1 ] . Value , "SourceControlData[1].Value" ) ;
316
+ list . Clear ( ) ;
317
+ Assert . AreEqual ( "sc1" , to . SourceControlData [ 1 ] . Name , "SourceControlData[1].Name" ) ;
318
+ }
319
+
320
+ [ Test ]
279
321
public void IfRequireChangesFromAllTrueAndAllSourceControlHasModificationsThenReturnMods ( )
280
322
{
281
323
//// SETUP
0 commit comments