private void AssertCounter(SocketOperation operation, Func<MockServerSocket4, long> delegatingRetriever, Func<PerformanceCounter> counterRetriever, int expectedCount)
		{
			MockServerSocket4 mockServerSocket = new MockServerSocket4();
			IServerSocket4 serverSocket = new MonitoredServerSocket4(mockServerSocket);

			FileSession().WithEnvironment(
				delegate
					{
						IList<ISocket4> clients = new List<ISocket4>();
						for (int i = 0; i < ClientCount; i++)
						{
							clients.Add(serverSocket.Accept());
						}

						for (int i = 0; i < clients.Count; i++)
						{
							operation(clients[i], i);
						}
					});

			Assert.AreEqual(expectedCount, delegatingRetriever(mockServerSocket));
			Assert.AreEqual(expectedCount, counterRetriever().RawValue);
		}
        private void AssertCounter(SocketOperation operation, Func <MockServerSocket4, long> delegatingRetriever, Func <PerformanceCounter> counterRetriever, int expectedCount)
        {
            MockServerSocket4 mockServerSocket = new MockServerSocket4();
            IServerSocket4    serverSocket     = new MonitoredServerSocket4(mockServerSocket);

            FileSession().WithEnvironment(
                delegate
            {
                IList <ISocket4> clients = new List <ISocket4>();
                for (int i = 0; i < ClientCount; i++)
                {
                    clients.Add(serverSocket.Accept());
                }

                for (int i = 0; i < clients.Count; i++)
                {
                    operation(clients[i], i);
                }
            });

            Assert.AreEqual(expectedCount, delegatingRetriever(mockServerSocket));
            Assert.AreEqual(expectedCount, counterRetriever().RawValue);
        }