Esempio n. 1
0
        public void RemoveFileTest()
        {
            var file = AllTestFiles.ElementAt(new Random().Next(0, AllTestFiles.Count()));

            FileManager.AddFile(file.FullPath);

            Check.That(file).Satisfies(FileManager.HasSimilarFile);

            FileManager.RemoveFile(file);

            Check.That(file).DoesNotSatisfy(FileManager.HasSimilarFile);
        }
Esempio n. 2
0
        public async Task ConvertAsNeededAsyncTest()
        {
            foreach (var fileName in AllTestFiles.Select(file => file.Name))
            {
                FileManager.AddFile(fileName);
            }
            await FileManager.ConvertAsNeededAsync();

            var filesUnconverted = FileManager.AllFiles
                                   .Except(FileManager.TxtFiles)
                                   .Except(FileManager.TaggedFiles)
                                   .Where(file => FileManager.TxtFiles.All(tf => tf.NameSansExt != file.NameSansExt));

            Check.That(filesUnconverted).IsEmpty();
        }
        public override void Reset()
        {
            foreach (var directory in testDirectories)
            {
                AllTestDirectories.Add(directory);
            }

            testDirectories.Clear();

            foreach (var fileName in testFiles)
            {
                AllTestFiles.Add(fileName);
            }

            testFiles.Clear();

            base.Reset();
        }