Exemple #1
0
        public void TemporaryFileDetachTest()
        {
            string path = string.Empty;

            using (TemporaryFile temporaryFile = new TemporaryFile(true, null))
            {
                path = temporaryFile.Path;
                File.Exists(temporaryFile.Path).Should().BeTrue();
                (File.GetAttributes(temporaryFile.Path) & FileAttributes.Temporary).Should().Be(FileAttributes.Temporary);
                temporaryFile.Detach();
            }
            File.Exists(path).Should().BeTrue();
            File.Delete(path);
        }
Exemple #2
0
        public void TemporaryFileDetachTest()
        {
            string path = string.Empty;

            using (TemporaryFile temporaryFile = new TemporaryFile(true, null))
            {
                path = temporaryFile.Path;
                Assert.That(File.Exists(temporaryFile.Path), Is.True);
                Assert.That((File.GetAttributes(temporaryFile.Path) & FileAttributes.Temporary) == FileAttributes.Temporary, Is.True);
                temporaryFile.Detach();
            }
            Assert.That(File.Exists(path), Is.True);
            File.Delete(path);
        }