コード例 #1
0
 public static void TestStressPUTRandomFixedSizeAsset1000()
 {
     for (var i = 0; i < 1000; ++i)
     {
         var asset = FullProtocolTests.CreateAndPutAsset(_socket, RandomBytes(10000, 10000));
         Assert.NotNull(asset, "Stress test failed.");
     }
 }
コード例 #2
0
        public static void TestStressPUTRandomFixedSizeAssetParallel1000()
        {
            var options = new ParallelOptions {
                MaxDegreeOfParallelism = 4
            };

            Parallel.For(0, 1000, options, index => {
                using (var socket = AuthTests.Connect()) {
                    var asset = FullProtocolTests.CreateAndPutAsset(socket, RandomBytes(10000, 10000));
                    Assert.NotNull(asset, "Stress test failed.");
                }
            });
        }