BlogSharp.Core.Impl.Tests.Services.FileSystem.TransactionalFileServiceTests.Can_move_file_in_transaction C# (CSharp) Метод

Can_move_file_in_transaction() приватный Метод

private Can_move_file_in_transaction ( ) : void
Результат void
        public void Can_move_file_in_transaction()
        {
            string fileName = "newFile.file";
            string destination = "merve.file";
            System.IO.File.Delete(destination);
            System.IO.File.Delete(fileName);
            System.IO.File.Create(fileName).Dispose();
            using (var scope = new TransactionScope())
            {
                fileService.MoveFile(fileName, destination);
                Assert.False(System.IO.File.Exists(destination));
                Assert.True(fileService.FileExists(destination));
                Assert.False(fileService.FileExists(fileName));
                scope.Complete();
            }

            Assert.True(System.IO.File.Exists(destination));
            System.IO.File.Delete(fileName);
            System.IO.File.Delete(destination);
        }