public void BuildFileList_WhenIsNotConfigOrDirectory_ReturnsListWithInputTarget() { var builder = new FileListBuilder(); var result = builder.BuildFileList(false, false, "file.js"); Assert.AreEqual(1, result.Count); Assert.AreEqual("file.js", result[0]); }
public void BuildListOfFiles_NoFilesExist_AllFilesAreReturned() { var resolution = new Resolution { Height = 360, Width = 240 }; var fileListBuilder = new FileListBuilder(); var files = fileListBuilder.BuildListOfFiles(resolution, "TestVideos"); Assert.AreEqual(4, files.Count); Assert.AreEqual(@"TestVideos\Source\Folder 1\DJI_0215.MP4", files[0]); Assert.AreEqual(@"TestVideos\Source\Folder 1\DJI_0216.MP4", files[1]); Assert.AreEqual(@"TestVideos\Source\Folder 2\DJI_0218.MP4", files[2]); Assert.AreEqual(@"TestVideos\Source\Folder 2\DJI_0225.MP4", files[3]); }
public void BuildFileList_WhenIsDirectory_CallsDirectoryTraverserToGetAllJSFiles() { var disk = Substitute.For<IDisk>(); var builder = new FileListBuilder(disk); disk.GetFiles(@"C:\JavaScript", "*.js", SearchOption.AllDirectories) .Returns(new[] { @"C:\JavaScript\File1.js", @"C:\JavaScript\Dir1\File2.js", @"C:\JavaScript\Dir2\File3.js", }); var result = builder.BuildFileList(false, true, @"C:\JavaScript"); Assert.AreEqual(3, result.Count); Assert.AreEqual(@"C:\JavaScript\File1.js", result[0]); Assert.AreEqual(@"C:\JavaScript\Dir1\File2.js", result[1]); Assert.AreEqual(@"C:\JavaScript\Dir2\File3.js", result[2]); }
public void Setup() { fileInstrumenter = Substitute.For<FileInstrumenter>(false); fileListBuilder = Substitute.For<FileListBuilder>(); diskIo = Substitute.For<IDisk>(); settings = new Settings(); controller = new CoverController(settings, fileListBuilder, diskIo); }