Update SocketOutputTests to account for the "immediate" Write param
This commit is contained in:
parent
6ff894bb19
commit
7446fe4cc7
|
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
_callbacksPending = new Queue<CallbackContext>();
|
_callbacksPending = new Queue<CallbackContext>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(ArraySegment<byte> buffer, Action<Exception, object> callback, object state, bool immediate)
|
public void Write(ArraySegment<byte> buffer, Action<Exception, object> callback, object state, bool immediate = true)
|
||||||
{
|
{
|
||||||
//TODO: need buffering that works
|
//TODO: need buffering that works
|
||||||
var copy = new byte[buffer.Count];
|
var copy = new byte[buffer.Count];
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
socketOutput.Write(buffer, onCompleted, state: null);
|
socketOutput.Write(buffer, onCompleted, null);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.True(completedWh.Wait(100));
|
Assert.True(completedWh.Wait(100));
|
||||||
|
|
@ -94,14 +94,14 @@ namespace Microsoft.AspNet.Server.KestrelTests
|
||||||
};
|
};
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
socketOutput.Write(buffer, onCompleted, state: null);
|
socketOutput.Write(buffer, onCompleted, null);
|
||||||
// Assert
|
// Assert
|
||||||
// The first write should pre-complete since it is <= _maxBytesPreCompleted.
|
// The first write should pre-complete since it is <= _maxBytesPreCompleted.
|
||||||
Assert.True(completedWh.Wait(100));
|
Assert.True(completedWh.Wait(100));
|
||||||
// Arrange
|
// Arrange
|
||||||
completedWh.Reset();
|
completedWh.Reset();
|
||||||
// Act
|
// Act
|
||||||
socketOutput.Write(buffer, onCompleted, state: null);
|
socketOutput.Write(buffer, onCompleted, null);
|
||||||
// Assert
|
// Assert
|
||||||
// Too many bytes are already pre-completed for the second write to pre-complete.
|
// Too many bytes are already pre-completed for the second write to pre-complete.
|
||||||
Assert.False(completedWh.Wait(100));
|
Assert.False(completedWh.Wait(100));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue