public void ParseEncodeTimeTest() { //Arrange const int hour=1; const int min = 34; const double sec = 23.54; const string ffmpegEncodeTime = "frame= 702 fps= 11 q=0.0 size= 775kB time={0}:{1}:{2} bitrate= 234.1kbits/s"; var str = String.Format(ffmpegEncodeTime, hour.ToString("d2"), min.ToString("d2"), sec.ToString("f2")); var parser = new VideoFfmpegParser(); //Act var result = parser.ParseEncodeTime(str); //Assert Assert.AreEqual(hour*3600+min*60+sec,result); }
public void ParseEncodeTimeWithNullStringTest() { //Arrange var parser = new VideoFfmpegParser(); //Act var result = parser.ParseEncodeTime(null); //Assert Assert.AreEqual(0, result); }
public void ParseEncodeTimeWithIncorrectStringTest() { //Arrange const string str = "incorrect string"; var parser = new VideoFfmpegParser(); //Act var result = parser.ParseEncodeTime(str); //Assert Assert.AreEqual(0, result); }