public void Initialize_PortNotOpen_AllBuffersUnused() { using (var port = MidiOutPortTests.CreateMidiOutPort()) { port.BufferManager.Initialize(2, 256); Assert.AreEqual(port.BufferManager.BufferCount, port.BufferManager.UnusedBufferCount); } }
private MidiOutPort CreateInitialzedOutPort() { var port = MidiOutPortTests.CreateMidiOutPort(); port.BufferManager.Initialize(2, 256); port.Open(0); return(port); }
public void Initialize_BuffersCreated_BufferSizeMatches() { using (var port = MidiOutPortTests.CreateMidiOutPort()) { port.BufferManager.Initialize(2, 256); port.Open(0); Assert.AreEqual(256, port.BufferManager.BufferSize); } }
public void Retrieve_InitializedBufferManager_ReturnsNonNull() { using (var port = MidiOutPortTests.CreateMidiOutPort()) { port.BufferManager.Initialize(2, 256); port.Open(0); var buffer = port.BufferManager.RetrieveBuffer(); Assert.IsNotNull(buffer); // return buffer or we get an exception on Dispose port.BufferManager.ReturnBuffer(buffer); } }
public void Retrieve_InitializedBufferManager_OneMoreUnusuableBuffer() { using (var port = MidiOutPortTests.CreateMidiOutPort()) { port.BufferManager.Initialize(2, 256); port.Open(0); var buffer = port.BufferManager.RetrieveBuffer(); Assert.AreEqual(1, port.BufferManager.UnusedBufferCount); // return buffer or we get an exception on Dispose port.BufferManager.ReturnBuffer(buffer); } }