public void TestVideoStoragerManager_SearchEarliestSubfolder_InvalidPath() { Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolder(null)); Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolder("ddddd")); Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolder(GlobalData.Path)); Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolder(@"D:\视频录像\videoID_003_2\2001\03\23")); string path = Path.Combine(GlobalData.Path, @"Empty Video"); Directory.CreateDirectory(path); Assert.IsNull(VideoStoragerManager.SearchEarliestSubfolder(path)); }
public void TestVideoStoragerManager_SearchEarliestSubfolder_One() { BaseInfo.AddOldVideo(); string videoId = "videoID_003"; int streamId = 2; string path = GlobalData.VideoPath(videoId, streamId); DateTime beginTime = new DateTime(2001, 3, 23, 01, 50, 1, 156); Directory.CreateDirectory(Path.Combine(path, @"10000\01\01")); Directory.CreateDirectory(Path.Combine(path, @"2001\1\01")); string earliestPath = Path.Combine(path, GlobalProcess.FolderPath(beginTime)); var info = VideoStoragerManager.SearchEarliestSubfolder(path); Assert.IsNotNull(info); Assert.AreEqual(earliestPath, info.Path); Assert.AreEqual(beginTime.Date, info.Time); }