Beispiel #1
0
 public void TestVideoStoragerManager_SearchEarliestSubfolders_NULL()
 {
     GlobalData.Path = null;
     Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolders());
     GlobalData.Path = @"D:\视频录像\videoID_003_2\123";
     Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolders());
     GlobalData.Path = @"D:\视频录像\videoID_003_2?\2001\03\23";
     Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolders());
     GlobalData.Path = @"i:\";
     Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolders());
     GlobalData.Path = @"D:\视频录像\";
 }
Beispiel #2
0
        public void TestVideoStoragerManager_SearchEarliestSubfolders_More()
        {
            BaseInfo.AddMoreOldVideos();
            DateTime start = DateTime.Now;
            var      pi    = VideoStoragerManager.SearchEarliestSubfolders();

            Console.WriteLine(DateTime.Now - start);
            Assert.IsTrue(TimeSpan.FromMilliseconds(20) > DateTime.Now - start);
            Assert.IsNotNull(pi);
            Assert.AreEqual(new DateTime(2000, 3, 23), pi.Time);
            Assert.AreEqual(100, pi.Paths.Length);
            start = DateTime.Now;
            VideoStoragerManager.DeleteEarliestVideo();
            Console.WriteLine(DateTime.Now - start);
            Assert.IsTrue(DateTime.Now - start < TimeSpan.FromMilliseconds(100));

            start = DateTime.Now;
            var pi1 = VideoStoragerManager.SearchEarliestSubfolders();

            Console.WriteLine(DateTime.Now - start);
            Assert.IsTrue(DateTime.Now - start < TimeSpan.FromMilliseconds(20));
            Assert.AreNotEqual(new DateTime(2000, 3, 23), pi1.Time);
        }