Closed
Description
The following code will throw an ArgumentException:
var buffer = new Windows.Storage.Streams.Buffer(0);
var array = buffer.ToArray();
WindowsRuntimeBufferExtensions.ToArray checks the buffer capacity as a precondition, which isn't used in the method. Obviously the expected behavior would be to return an array of length zero.
I also can't find a unit test for this case.