public void TryAcquire_should_not_allocate_new_buffers_when_there_are_spare_ones() { memoryManager.ClearReceivedCalls(); for (var i = 0; i < 3; i++) { pool.TryAcquire(out _).Should().BeTrue(); } memoryManager.ReceivedCalls().Should().BeEmpty(); }
public void Should_not_call_to_underlying_memory_manager_when_exhausted() { memoryManager.TryReserveBytes(MaxSize).Should().BeTrue(); underlyingMemoryManager.ClearReceivedCalls(); memoryManager.TryReserveBytes(1).Should().BeFalse(); underlyingMemoryManager.DidNotReceiveWithAnyArgs().TryReserveBytes(0); }