コード例 #1
0
        public void Test9()
        {
            ArrayList           events         = new ArrayList();
            DummyConnection     connection     = new DummyConnection(events);
            DummyChoker         choker         = new DummyChoker(events);
            DummyStorageWrapper storageWrapper = new DummyStorageWrapper(events);

            new Upload(connection, choker, storageWrapper, 100, 20, 5);
        }
コード例 #2
0
        public void Test7()
        {
            ArrayList           events         = new ArrayList();
            DummyConnection     connection     = new DummyConnection(events);
            DummyChoker         choker         = new DummyChoker(events);
            DummyStorageWrapper storageWrapper = new DummyStorageWrapper(events);
            Upload upload = new Upload(connection, choker, storageWrapper, 100, 20, 5);

            upload.GetRequest(0, 1, 3);
        }
コード例 #3
0
        public void Test4()
        {
            ArrayList           events         = new ArrayList();
            DummyConnection     connection     = new DummyConnection(events);
            DummyChoker         choker         = new DummyChoker(events);
            DummyStorageWrapper storageWrapper = new DummyStorageWrapper(events);
            Upload upload = new Upload(connection, choker, storageWrapper, 100, 20, 5);

            upload.Unchoke();
            upload.GetInterested();
            connection.Flushed = true;
            upload.GetRequest(0, 1, 3);
        }
コード例 #4
0
        public void Test1()
        {
            ArrayList           events         = new ArrayList();
            DummyConnection     connection     = new DummyConnection(events);
            DummyChoker         choker         = new DummyChoker(events);
            DummyStorageWrapper storageWrapper = new DummyStorageWrapper(events);
            Upload upload = new Upload(connection, choker, storageWrapper, 100, 20, 5);

            Assert.AreEqual(true, upload.Choked);
            Assert.AreEqual(false, upload.Interested);

            upload.GetInterested();
            Assert.AreEqual(true, upload.Interested);

            upload.GetRequest(0, 0, 3);
            connection.Flushed = true;
            upload.Flush();
        }