2 // BackgroundWorkerTest.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
7 // Copyright (C) 2007 Novell, Inc.
13 using System.ComponentModel;
14 using System.Globalization;
16 using NUnit.Framework;
18 namespace MonoTests.System.ComponentModel
21 public class BackgroundWorkerTest
24 [ExpectedException (typeof (InvalidOperationException))]
25 public void ReportProgressNoReportingSupported ()
27 BackgroundWorker b = new BackgroundWorker ();
28 Assert.IsFalse (b.IsBusy, "#1");
33 public void ReportProgressNonBusy ()
35 BackgroundWorker b = new BackgroundWorker ();
36 b.WorkerReportsProgress = true;
37 Assert.IsFalse (b.IsBusy, "#1");
42 [ExpectedException (typeof (InvalidOperationException))]
43 public void CancelAsyncNoCancellationSupported ()
45 BackgroundWorker b = new BackgroundWorker ();
46 Assert.IsFalse (b.IsBusy, "#1");
51 public void CancelAsyncNonBusy ()
53 BackgroundWorker b = new BackgroundWorker ();
54 b.WorkerSupportsCancellation = true;
55 Assert.IsFalse (b.IsBusy, "#1");