Пример #1
0
        public async Task CopyWithSubDirectory()
        {
            var mockDirectory1 = new MockDirectoryTreeBuilder().Folder("F1").Object;

            mockDirectory1.Create();
            var mockDirectory2 = new MockDirectory("c:\\Mock2");

            await mockDirectory2.CopyFrom(mockDirectory1);

            Assert.True(mockDirectory1.SubDirectory("F1").Exists());
            Assert.True(mockDirectory2.SubDirectory("F1").Exists());
        }
Пример #2
0
        public async Task CopyEmptyDirectory()
        {
            var mockDirectory1 = new MockDirectory("c:\\Mock1");

            mockDirectory1.Create();
            var mockDirectory2 = new MockDirectory("c:\\Mock2");

            await mockDirectory2.CopyFrom(mockDirectory1);

            Assert.True(mockDirectory1.Exists());
            Assert.True(mockDirectory2.Exists());
        }
Пример #3
0
        public async Task CopyWithFile()
        {
            var mockDirectory1 = new MockDirectoryTreeBuilder().File("F1", "content").Object;

            mockDirectory1.Create();
            var mockDirectory2 = new MockDirectory("c:\\Mock2");

            await mockDirectory2.CopyFrom(mockDirectory1);

            Assert.True(mockDirectory1.File("F1").Exists());
            Assert.True(mockDirectory2.File("F1").Exists());
            Assert.Equal("content", mockDirectory2.File("F1").Content());
        }