Пример #1
0
        public async Task RunParallelEncryptionTest(Action encryptionAction)
        {
            // run it once before the multi-threading test to initialize global tables
            encryptionAction();
            await GenerateParallelRunningEncryptionTask(encryptionAction, 10);

            RNG.Close();
        }
Пример #2
0
        public void TestOpenSSLEncryption()
        {
            // run it once before the multi-threading test to initialize global tables
            RunSingleOpenSSLEncryptionThread();
            List <Thread> threads = new List <Thread>();

            for (int i = 0; i < 10; i++)
            {
                Thread t = new Thread(new ThreadStart(RunSingleOpenSSLEncryptionThread));
                threads.Add(t);
                t.Start();
            }
            foreach (Thread t in threads)
            {
                t.Join();
            }
            RNG.Close();
            Assert.IsFalse(encryptionFailed);
        }
Пример #3
0
 public void OneTimeTearDown()
 {
     RNG.Close();
 }
Пример #4
0
 public void TearDown()
 {
     RNG.Close();
     // reset flag in case they interfere each other
     encryptionFailed = false;
 }