public void ReregisterManager()
        {
            ManualResetEvent handle = new ManualResetEvent(false);

            rig.Manager.TorrentStateChanged += delegate(object sender, TorrentStateChangedEventArgs e)
            {
                if (e.OldState == TorrentState.Hashing)
                {
                    handle.Set();
                }
            };
            rig.Manager.HashCheck(false);

            handle.WaitOne();
            handle.Reset();

            rig.Engine.Unregister(rig.Manager);
            TestRig rig2 = TestRig.CreateMultiFile(new TestWriter());

            rig2.Engine.Unregister(rig2.Manager);
            rig.Engine.Register(rig2.Manager);
            rig2.Manager.TorrentStateChanged += delegate(object sender, TorrentStateChangedEventArgs e)
            {
                if (e.OldState == TorrentState.Hashing)
                {
                    handle.Set();
                }
            };
            rig2.Manager.HashCheck(true);
            handle.WaitOne();
            rig2.Dispose();
        }
Beispiel #2
0
 public void GlobalTeardown()
 {
     rig.Dispose();
 }
Beispiel #3
0
 public void FixtureTeardown()
 {
     rig.Dispose();
 }
 public void Teardown()
 {
     rig.Dispose();
     conn.Dispose();
 }
Beispiel #5
0
 public void Teardown()
 {
     rig.Manager.Stop();
     pair.Dispose();
     rig.Dispose();
 }
Beispiel #6
0
 public void Dispose()
 {
     rig.Manager.Stop();
     pair.Dispose();
     rig.Dispose();
 }
Beispiel #7
0
 public void Dispose()
 {
     listener.Close();
     rig.Dispose();
 }
 public void Dispose()
 {
     TestRig.Dispose();
 }
 public void Dispose()
 {
     rig.Dispose();
     conn.Dispose();
 }
 public void TearDown()
 {
     listener.Close();
     rig.Dispose();
 }
 public void FixtureTeardown()
 {
     testRig.Dispose();
 }