コード例 #1
0
        public void AddingDirectory_AddsContents()
        {
            var files = new List <TFile>
            {
                new TFile {
                    Name = "file0"
                },
                new TFile {
                    Name = "file1"
                },
                new TFile {
                    Name = "file2"
                },
                new TFile {
                    Name = "file3"
                }
            };

            var dirSubSub = new Directory("subSubDirectory")
            {
                Data = new List <FileBase> {
                    files[3]
                }
            };
            var dirSub = new Directory("subDirectory")
            {
                Data = new List <FileBase> {
                    files[2], dirSubSub
                }
            };
            var dirMain = new Directory("fullDirectory")
            {
                Data = new List <FileBase> {
                    files[1], files[0], dirSub
                }
            };

            filesystem.AddFile(dirMain, filesystem.RootDirectory);

            foreach (var file in files)
            {
                Assert.That(filesystem.FileExistsInFilesystem(file), $"file {file.Name} should exist");
            }
        }