public void TemporaryFile_has_FileAttributes_Temporary_by_default()
{
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 );
}
Assert.That( File.Exists( path ), Is.False );
using( TemporaryFile temporaryFile = new TemporaryFile() )
{
path = temporaryFile.Path;
Assert.That( File.Exists( temporaryFile.Path ), Is.True );
Assert.That( (File.GetAttributes( temporaryFile.Path ) & FileAttributes.Temporary) == FileAttributes.Temporary, Is.True );
}
Assert.That( File.Exists( path ), Is.False );
using( TemporaryFile temporaryFile = new TemporaryFile( true ) )
{
path = temporaryFile.Path;
Assert.That( File.Exists( temporaryFile.Path ), Is.True );
Assert.That( (File.GetAttributes( temporaryFile.Path ) & FileAttributes.Temporary) == FileAttributes.Temporary, Is.True );
}
Assert.That( File.Exists( path ), Is.False );
}