Exemplo n.º 1
0
 public static void AssertAreEqual(VideoTimePeriodsPacket exp, VideoTimePeriodsPacket act)
 {
     Assert.AreNotSame(exp, act);
     Assert.AreEqual(exp.VideoId, act.VideoId);
     Assert.AreEqual(exp.StreamId, act.StreamId);
     TimePeriodPacketTest.AssertAreEqualArray(exp.TimePeriods, act.TimePeriods);
 }
 public void TestDownloadInfoPartConverter_TimePeriodsCompleted()
 {
     byte[] buffer = DownloadInfoPartConverter.Encode(down, nameof(down.TimePeriodsCompleted));
     DownloadExpandPart part = DownloadInfoPartConverter.Decode(buffer);
     Assert.AreEqual(down.GuidCode, part.GuidCode);
     Assert.AreEqual(DownloadCode.TimePeriodsCompleted, part.Code);
     TimePeriodPacketTest.AssertAreEqualArray(down.TimePeriodsCompleted, (TimePeriodPacket[])part.Value);
 }
Exemplo n.º 3
0
 private void assertAreEqual(DownloadInfoExpandPacket p1, DownloadInfoExpandPacket p2)
 {
     Assert.AreEqual(p1.GuidCode, p2.GuidCode);
     Assert.AreEqual(p1.Name, p2.Name);
     Assert.AreEqual(p1.Quality, p2.Quality);
     Assert.AreEqual(p1.Size, p2.Size);
     Assert.AreEqual(p1.IsLocalDownload, p2.IsLocalDownload);
     Assert.AreEqual(p1.DownloadStatus, p2.DownloadStatus);
     TimePeriodPacketTest.AssertAreEqualArray(p1.TimePeriodsAll, p2.TimePeriodsAll);
     TimePeriodPacketTest.AssertAreEqualArray(p1.TimePeriodsCompleted, p2.TimePeriodsCompleted);
     Assert.AreEqual(p1.ErrorInfo, p2.ErrorInfo);
     Assert.AreEqual(p1.UpdatedLastestTime, p2.UpdatedLastestTime);
     Assert.AreEqual(p1.Speed, p2.Speed);
 }