Esempio n. 1
0
        public void Teardown()
        {
            DhtEngineFactory.Creator = listener => new DhtEngine(listener);

            rig.Dispose();
            conn.Dispose();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        public async Task Teardown()
        {
            await rig.Manager.StopAsync();

            pair.Dispose();
            rig.Dispose();
        }
Esempio n. 4
0
        public async Task ReregisterManager()
        {
            var hashingTask = rig.Manager.WaitForState(TorrentState.Stopped);
            await rig.Manager.HashCheckAsync(false);

            await hashingTask;

            await rig.Engine.Unregister(rig.Manager);

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

            await rig.Engine.Register(rig2.Manager);

            hashingTask = rig2.Manager.WaitForState(TorrentState.Downloading);
            await rig2.Manager.HashCheckAsync(true);

            await hashingTask;
            await rig2.Manager.StopAsync();

            rig2.Dispose();
        }
Esempio n. 5
0
 public void GlobalTeardown()
 {
     rig.Dispose();
 }
Esempio n. 6
0
 public void TearDown()
 {
     rig.Dispose();
 }
Esempio n. 7
0
 public void FixtureTeardown()
 {
     rig.Dispose();
 }
Esempio n. 8
0
 public void Teardown()
 {
     rig.Manager.Stop();
     pair.Dispose();
     rig.Dispose();
 }
Esempio n. 9
0
 public void TearDown()
 {
     listener.Close();
     rig.Dispose();
 }
 public void Teardown()
 {
     rig?.Dispose();
 }
Esempio n. 11
0
 public void Teardown()
 {
     rig.Dispose();
     conn.Dispose();
 }
Esempio n. 12
0
 public void Teardown()
 {
     handle.Close();
     rig.Dispose();
 }
Esempio n. 13
0
 public void FixtureTeardown()
 {
     testRig.Dispose();
 }
 public void GlobalTeardown()
 {
     testRig?.Dispose();
 }
Esempio n. 15
0
        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 = new TestRig("", 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();
        }