mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Merge pull request #5069 from ivandrofly/timecode-test
[unittest] - improve time code unittest
This commit is contained in:
commit
826180b8dd
@ -101,5 +101,44 @@ namespace Test.Logic
|
||||
Assert.AreEqual("00:00", res);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ToHHMMSSFFTestSecond()
|
||||
{
|
||||
Configuration.Settings.General.CurrentFrameRate = 00;
|
||||
var res = new TimeCode(23, 23, 21, 0).ToHHMMSSFF();
|
||||
|
||||
// note: one second is added when converting to ToHHMMSSFF
|
||||
Assert.AreEqual("23:23:22:00", res);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ToHHMMSSFFTestFrame()
|
||||
{
|
||||
Configuration.Settings.General.CurrentFrameRate = 25;
|
||||
var res = new TimeCode(23, 23, 21, 0).ToHHMMSSFF();
|
||||
|
||||
// note: one second is added when converting to ToHHMMSSFF
|
||||
Assert.AreEqual("23:23:21:00", res);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ToHHMMSSFFTestNegative()
|
||||
{
|
||||
Configuration.Settings.General.CurrentFrameRate = 00;
|
||||
var res = new TimeCode(1, -1, 0, 0).ToHHMMSSFF();
|
||||
|
||||
// note: one second is added when converting to ToHHMMSSFF
|
||||
Assert.AreEqual("00:59:01:00", res);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ToHHMMSSPeriodFFTest()
|
||||
{
|
||||
Configuration.Settings.General.CurrentFrameRate = 00;
|
||||
var res = new TimeCode(23, 23, 21, 0).ToHHMMSSPeriodFF();
|
||||
|
||||
// note: one second is added when converting to ToHHMMSSFF
|
||||
Assert.AreEqual("23:23:22.00", res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user