コード例 #1
0
        public void CreateDirectoryInPlace()
        {
            var directory = new Directory(Path.GetRandomFileName())
            {
                d => new Directory(d, s_Dir1),
                d => new Directory(d, s_Dir2),
                d => new EmptyFile(d, s_File1)
            };

            using (var temporaryDirectory = m_Instance.CreateTemporaryDirectory())
            {                
                m_Instance.CreateDirectoryInPlace(directory, temporaryDirectory.Directory.Location);
                
                Assert.NotEqual(temporaryDirectory.Directory.Name, directory.Name);
                Assert.Equal(directory.Directories.Count(), temporaryDirectory.Directory.Directories.Count());
                Assert.True(directory.DirectoryExists(s_Dir1));
                Assert.True(directory.DirectoryExists(s_Dir2));
                Assert.Equal(directory.Files.Count(), temporaryDirectory.Directory.Files.Count());
                Assert.True(directory.FileExists(s_File1));
            }
        }