Example #1
0
        public void PoolCanGetMoreWritersThanPoolSize()
        {
            NetworkWriterPool.Capacity = 5;

            const int testWriterCount = 10;
            var       writers         = new PooledNetworkWriter[testWriterCount];

            for (int i = 0; i < testWriterCount; i++)
            {
                writers[i] = NetworkWriterPool.GetWriter();
            }

            // Make sure all writers are different
            Assert.That(writers.Distinct().Count(), Is.EqualTo(testWriterCount));
        }