예제 #1
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.");
                }
            });
        }
예제 #2
0
        public static void TestServiceMultipleGoodRequests()
        {
            using (var socket = AuthTests.Connect()) {
                for (var index = 0; index < 10; ++index)
                {
                    var request = new ClientRequestMsg(ClientRequestMsg.RequestType.STATUS_GET, Guid.Empty.ToString());
                    request.Send(socket);

                    while (socket.Available <= 0)
                    {
                    }

#pragma warning disable RECS0026 // Possible unassigned object created by 'new'
                    new ServerResponseMsg(socket);
#pragma warning restore RECS0026 // Possible unassigned object created by 'new'
                    // Don't care what the reponse was.
                }
            }
        }
예제 #3
0
 public static void Setup()
 {
     _socket = AuthTests.Connect();
 }