コード例 #1
0
        public void ExecuteCommands_OnlyFilesProcessed()
        {
            var fs = new MockFileSystem(new Dictionary <string, MockFileData>()
            {
                { @"c:\dir1\file1.txt", new MockFileData("data") },
                { @"c:\dir1\_file2.txt", new MockFileData("data") },
                { @"c:\dir2\file1.txt", new MockFileData("data") },
                { @"c:\dir2\_file2.txt", new MockFileData("data") },
                { @"c:\dir1\files", new MockDirectoryData() },
                { @"c:\dir2\_files", new MockDirectoryData() },
            }
                                        );
            var cmd = ExecuteCommands_SetupCommand();

            var executor = new CommandsExecutor(fs, cmd);

            executor.ExecuteCommands();

            Assert.True(fs.FileExists(@"c:\dir1\file1.txt"));
            Assert.True(fs.FileExists(@"c:\dir2\file1.txt"));

            Assert.True(fs.FileExists(@"c:\dir1\file2.txt"));
            Assert.True(fs.FileExists(@"c:\dir2\file2.txt"));

            Assert.True(fs.Directory.Exists(@"c:\dir1\files"));
            Assert.True(fs.Directory.Exists(@"c:\dir2\_files"));
        }