Enable Microsoft.AspNet.WebSockets.Protocol.Test on CoreCLR.

This commit is contained in:
Cesar Blum Silveira 2015-10-16 16:47:52 -07:00
parent 187221fcd8
commit f784b1bf43
3 changed files with 17 additions and 6 deletions

View File

@ -138,6 +138,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
} }
} }
#if !DNXCORE50
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{ {
// TODO: This option doesn't preserve the state object. // TODO: This option doesn't preserve the state object.
@ -197,6 +198,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
_readLock.Release(); _readLock.Release();
} }
} }
#endif
// Write with count 0 will still trigger OnFirstWrite // Write with count 0 will still trigger OnFirstWrite
public override void Write(byte[] buffer, int offset, int count) public override void Write(byte[] buffer, int offset, int count)
@ -224,6 +226,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
} }
} }
#if !DNXCORE50
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{ {
Write(buffer, offset, count); Write(buffer, offset, count);
@ -254,6 +257,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
Write(buffer, offset, count); Write(buffer, offset, count);
return Task.FromResult<object>(null); return Task.FromResult<object>(null);
} }
#endif
private static void VerifyBuffer(byte[] buffer, int offset, int count, bool allowEmpty) private static void VerifyBuffer(byte[] buffer, int offset, int count, bool allowEmpty)
{ {

View File

@ -93,6 +93,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
return _readStream.Read(buffer, offset, count); return _readStream.Read(buffer, offset, count);
} }
#if !DNXCORE50
public override int ReadByte() public override int ReadByte()
{ {
return _readStream.ReadByte(); return _readStream.ReadByte();
@ -117,6 +118,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
{ {
return _readStream.CopyToAsync(destination, bufferSize, cancellationToken); return _readStream.CopyToAsync(destination, bufferSize, cancellationToken);
} }
#endif
#endregion Read #endregion Read
@ -127,6 +129,7 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
_writeStream.Write(buffer, offset, count); _writeStream.Write(buffer, offset, count);
} }
#if !DNXCORE50
public override void WriteByte(byte value) public override void WriteByte(byte value)
{ {
_writeStream.WriteByte(value); _writeStream.WriteByte(value);
@ -147,15 +150,16 @@ namespace Microsoft.AspNet.WebSockets.Protocol.Test
return _writeStream.WriteAsync(buffer, offset, count, cancellationToken); return _writeStream.WriteAsync(buffer, offset, count, cancellationToken);
} }
public override void Flush()
{
_writeStream.Flush();
}
public override Task FlushAsync(CancellationToken cancellationToken) public override Task FlushAsync(CancellationToken cancellationToken)
{ {
return _writeStream.FlushAsync(cancellationToken); return _writeStream.FlushAsync(cancellationToken);
} }
#endif
public override void Flush()
{
_writeStream.Flush();
}
#endregion Write #endregion Write

View File

@ -4,7 +4,10 @@
"xunit.runner.aspnet": "2.0.0-aspnet-*" "xunit.runner.aspnet": "2.0.0-aspnet-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { } "dnx451": { },
"dnxcore50": {
"System.IO": "4.0.11-beta-*"
}
}, },
"commands": { "commands": {
"test": "xunit.runner.aspnet" "test": "xunit.runner.aspnet"