public void NSUrl_Subclass() { string file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "uidocument.txt"); if (File.Exists(file)) { File.Delete(file); } // interesting limitation using (MyUrl url2 = new MyUrl(file, "my document")) { // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: must pass a valid file URL to -[UIDocument initWithFileURL:] #if NET Assert.Throws <ObjCException> (delegate { #else Assert.Throws <MonoTouchException> (delegate { #endif new DocumentPoker(url2); }); } }
public void NSUrl_Subclass() { if (Runtime.Arch == Arch.DEVICE) { Assert.Inconclusive("will crash runner application after test execution"); } string file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "uidocument.txt"); if (File.Exists(file)) { File.Delete(file); } // interesting limitation using (MyUrl url2 = new MyUrl(file, "my document")) { // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: must pass a valid file URL to -[UIDocument initWithFileURL:] Assert.Throws <MonoTouchException> (delegate { new DocumentPoker(url2); }); } }