Beispiel #1
0
        public void Reflow_RenameFiles_Should_Successfully_Rename_Files()
        {
            var filesLocation = @"..\..\..\RenameFilesSample\Files";
            var tagJson       = @"..\..\..\RenameFilesSample\AddTag.json";

            var filesDirectory = _reflow.GetFilesInDirectory(filesLocation);
            var addTag         = _reflow.AddTag(System.IO.File.ReadAllText(tagJson));
            var files          = _reflow.GetFiles(null).Result;
            var res            = ParseUtils.ParseCollection <ReflowFile>(files);

            var settings = new ReflowRenameOptionSet()
            {
                CreateBackup       = false,
                BackupFolder       = "",
                FileExistsStrategy = FileExistsStrategy.Skip,
                FileExistsFolder   = ""
            };

            var rename = _reflow.RenameFiles(JsonConvert.SerializeObject(settings)).Result;
        }
Beispiel #2
0
        public void Reflow_WorkflowTest_01()
        {
            var filesLocation = @"..\..\..\ComboSamples\01\Files";
            var tagJson       = @"..\..\..\ComboSamples\01\AddTag.json";
            var updateJson    = @"..\..\..\ComboSamples\01\UpdateTag.json";

            var filesDirectory = _reflow.GetFilesInDirectory(filesLocation);
            var addTag         = _reflow.AddTag(System.IO.File.ReadAllText(tagJson));
            var update         = _reflow.UpdateTagsData(System.IO.File.ReadAllText(updateJson));
            var files          = _reflow.GetFiles(null).Result;

            var res = ParseUtils.ParseCollection <ReflowFile>(files);

            res.Count.Should().Be(6);
            res[0].NewName.Should().Be("05");
            res[1].NewName.Should().Be("10");
            res[2].NewName.Should().Be("15");
            res[3].NewName.Should().Be("20");
            res[4].NewName.Should().Be("25");
            res[5].NewName.Should().Be("30");
        }