public static void FindServicePoint_PropertiesRoundtrip()
{
string address = "http://" + Guid.NewGuid().ToString("N");
BindIPEndPoint expectedBindIPEndPointDelegate = delegate { return null; };
int expectedConnectionLeaseTimeout = 42;
int expectedConnectionLimit = 84;
bool expected100Continue = false;
int expectedMaxIdleTime = 200000;
int expectedReceiveBufferSize = 123;
bool expectedUseNagleAlgorithm = false;
ServicePoint sp1 = ServicePointManager.FindServicePoint(address, null);
sp1.BindIPEndPointDelegate = expectedBindIPEndPointDelegate;
sp1.ConnectionLeaseTimeout = expectedConnectionLeaseTimeout;
sp1.ConnectionLimit = expectedConnectionLimit;
sp1.Expect100Continue = expected100Continue;
sp1.MaxIdleTime = expectedMaxIdleTime;
sp1.ReceiveBufferSize = expectedReceiveBufferSize;
sp1.UseNagleAlgorithm = expectedUseNagleAlgorithm;
ServicePoint sp2 = ServicePointManager.FindServicePoint(address, null);
Assert.Same(expectedBindIPEndPointDelegate, sp2.BindIPEndPointDelegate);
Assert.Equal(expectedConnectionLeaseTimeout, sp2.ConnectionLeaseTimeout);
Assert.Equal(expectedConnectionLimit, sp2.ConnectionLimit);
Assert.Equal(expected100Continue, sp2.Expect100Continue);
Assert.Equal(expectedMaxIdleTime, sp2.MaxIdleTime);
Assert.Equal(expectedReceiveBufferSize, sp2.ReceiveBufferSize);
Assert.Equal(expectedUseNagleAlgorithm, sp2.UseNagleAlgorithm);
}