@@ -1554,13 +1554,14 @@ public void ShiftClipsAtOrAfterBlockIfAllClipsAreBeforeDate_AllFilesModifiedBefo
1554
1554
const int kTestChapter = 1 ;
1555
1555
1556
1556
var chapterFolder = ClipRepository . GetChapterFolder ( testProject , kTestBook , kTestChapter ) ;
1557
- ChapterRecordingInfoBase info ;
1557
+ TestChapterInfo info ;
1558
1558
if ( includeClip0 )
1559
1559
info = new TestChapterInfo ( 1 , 2 , 3 , 8 ) ; // Intentionally omitted 4, just to make sure the logic is okay with having one missing.
1560
1560
else
1561
1561
info = new TestChapterInfo ( 2 , 3 , 8 ) ; // Intentionally omitted 4, just to make sure the logic is okay with having one missing.
1562
1562
info . RecordingInfo [ 1 ] . SkippedChanged += sender => { } ; // code requires us to have a handler before we can set it.
1563
1563
info . RecordingInfo [ 1 ] . Skipped = true ;
1564
+ info . ExpectedPreserveModifiedTime = true ;
1564
1565
1565
1566
try
1566
1567
{
@@ -1575,13 +1576,15 @@ public void ShiftClipsAtOrAfterBlockIfAllClipsAreBeforeDate_AllFilesModifiedBefo
1575
1576
// SUT
1576
1577
Assert . IsTrue ( ClipRepository . ShiftClipsAtOrAfterBlockIfAllClipsAreBeforeDate (
1577
1578
testProject , kTestBook , kTestChapter , 1 , DateTime . UtcNow , ( ) => info ) ) ;
1579
+
1578
1580
Assert . AreEqual ( includeClip0 ? 5 : 4 , Directory . GetFiles ( chapterFolder ) . Length ) ;
1579
1581
Assert . That ( File . Exists ( Path . Combine ( chapterFolder , "8.wav" ) ) ) ;
1580
1582
Assert . That ( File . Exists ( Path . Combine ( chapterFolder , "4.wav" ) ) ) ;
1581
1583
Assert . That ( File . Exists ( Path . Combine ( chapterFolder , "3.skip" ) ) ) ;
1582
1584
Assert . That ( File . Exists ( Path . Combine ( chapterFolder , "2.wav" ) ) ) ;
1583
1585
Assert . IsFalse ( File . Exists ( Path . Combine ( chapterFolder , "1.wav" ) ) ) ;
1584
1586
Assert . AreEqual ( includeClip0 , File . Exists ( file0 ) ) ;
1587
+ Assert . AreEqual ( 1 , info . SaveCallCount ) ;
1585
1588
1586
1589
int i = 0 ;
1587
1590
if ( includeClip0 )
@@ -1889,6 +1892,7 @@ private class TestChapterInfo : ChapterRecordingInfoBase
1889
1892
private readonly List < ScriptLine > _recordings ;
1890
1893
1891
1894
public int SaveCallCount { get ; private set ; }
1895
+ public bool ExpectedPreserveModifiedTime { get ; set ; }
1892
1896
1893
1897
public TestChapterInfo ( params int [ ] scriptLineNumbers )
1894
1898
{
@@ -1905,6 +1909,7 @@ public override void OnScriptBlockRecorded(ScriptLine selectedScriptBlock)
1905
1909
1906
1910
public override void Save ( bool preserveModifiedTime = false )
1907
1911
{
1912
+ Assert . AreEqual ( ExpectedPreserveModifiedTime , preserveModifiedTime ) ;
1908
1913
SaveCallCount ++ ;
1909
1914
}
1910
1915
}
0 commit comments