public void SetUp()
        {
            m_ObjectPoolModule = new RefPoolModule();
            m_ObjectPoolModule.Init();

            m_DownloadModule = new DownloadModule();
            m_DownloadModule.ChunkSizeToSave = 1024;
            m_DownloadModule.ConcurrentDownloadCountLimit = 2;
            m_DownloadModule.TempFileExtension            = ".tmp";
            m_DownloadModule.Timeout          = 10000f;
            m_DownloadTaskPool                = Substitute.For <IDownloadTaskPool>();
            m_DownloadModule.DownloadTaskPool = m_DownloadTaskPool;
            m_DownloadModule.RefPoolModule    = m_ObjectPoolModule;
            m_DownloadModule.Init();
        }
Exemple #2
0
        public void SetUp()
        {
            if (Directory.Exists(SavePathRoot))
            {
                Directory.Delete(SavePathRoot, true);
            }

            if (!Directory.Exists(SavePathRoot))
            {
                Directory.CreateDirectory(SavePathRoot);
            }

            m_DirectoryInfo = new DirectoryInfo(SavePathRoot);

            m_ObjectPoolModule = new RefPoolModule();
            m_ObjectPoolModule.Init();

            m_DownloadModule = new DownloadModule();
            m_DownloadModule.ChunkSizeToSave = 32;
            m_DownloadModule.ConcurrentDownloadCountLimit = 2;
            m_DownloadModule.TempFileExtension            = ".tmp";
            m_DownloadModule.Timeout = 10000f;

            m_DownloadTaskPool = Substitute.For <IDownloadTaskPool>();
            m_DownloadTaskPool.Acquire().Returns(callInfo => new DownloadTask());

            m_DownloadTaskImplFactory = new MockDownloadTaskImplFactory();
            var mockDownloadTaskImplFactory = m_DownloadTaskImplFactory as MockDownloadTaskImplFactory;

            mockDownloadTaskImplFactory.TaskShouldNeverStart = false;

            m_DownloadModule.DownloadTaskPool        = m_DownloadTaskPool;
            m_DownloadModule.RefPoolModule           = m_ObjectPoolModule;
            m_DownloadModule.DownloadTaskImplFactory = m_DownloadTaskImplFactory;
            m_DownloadModule.Init();
        }