public void CanPurgeAndSHutdown() { //#FIXME - not a test - just an excercise - need to expose internals so we can peek the request queue var server = new CassiniDevServer(); server.StartServer(ContentLocation); string root = server.RootUrl.TrimEnd('/'); var client = new ClientBase(new Serializer()); try { for (int i = 0; i < 50; i++) { client.BeginRequest(RequestMethod.GET, root, "/SampleClientHandler.ashx?foo={foo}", null, new Dictionary<string, object>() { { "foo", "foo" + i } }, ContentType.TEXT, ContentType.JSON, TimeSpan.FromSeconds(1), 3000, 0, ar => { }, null); } var handle = client.ShutDown(); if (!handle.WaitOne(20000)) { throw new Exception("timed out"); } } finally { server.Dispose(); } }
public void CanPurgeAndSHutdownWithNoPendingRequests() { var client = new ClientBase(new Serializer()); var handle = client.ShutDown(); if(!handle.WaitOne(1000)) { Assert.Fail("handle should already be set"); } }