Ejemplo n.º 1
0
        public async Task MoveWithSubDirectory()
        {
            var mockDirectory1 = new MockDirectoryTreeBuilder().Folder("F1").Object;

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

            await mockDirectory2.MoveFrom(mockDirectory1);

            Assert.False(mockDirectory1.SubDirectory("F1").Exists());
            Assert.True(mockDirectory2.SubDirectory("F1").Exists());
        }
Ejemplo n.º 2
0
        public async Task MoveWithFile()
        {
            var mockDirectory1 = new MockDirectoryTreeBuilder().File("F1", "content").Object;

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

            await mockDirectory2.MoveFrom(mockDirectory1);

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