[Mono-bugs] [Bug 378229] New: File.Delete on read-only file should throw System. UnauthorizedAccessException

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 9 03:56:04 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=378229


           Summary: File.Delete on read-only file should throw
                    System.UnauthorizedAccessException
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: albright at wesay.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


[TestFixture]
public class FileDelete
{
    string file;
    [SetUp]
    public void Setup()
    {
        file = Path.GetTempFileName();
    }

    [TearDown]
    public void TearDown()
    {
        if (File.Exists(file))
        {
            File.SetAttributes(file, FileAttributes.Normal);
            File.Delete(file);
        }
    }

    [Test]
    [ExpectedException(typeof(UnauthorizedAccessException))]
    public void FileDelete_FileIsReadOnly_Throws()
    {
        File.SetAttributes(file, FileAttributes.ReadOnly);
        File.Delete(file);
    }

}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list