public void RentAndPopulateFromStream_ShouldThrow_WhenStreamIsNotReadable() { var stream = new NonReadableStream(); Action act = () => SqsReceiveResponseMemoryPool.RentAndPopulateFromStream(stream, 1); act.Should().Throw <ArgumentException>(because: "the stream must be readable"); }
public async Task RentAndPopulateFromStreamAsync_ShouldThrow_WhenStreamIsNotReadable() { var stream = new NonReadableStream(); Func <Task> func = async() => await SqsReceiveResponseMemoryPool.RentAndPopulateFromStreamAsync(stream, 1); await func.Should().ThrowAsync <ArgumentException>(because: "the stream must be readable."); }
public void ReadExact_ShouldThrowIfStreamIsNonReadable() { var stream = new NonReadableStream(); stream.ReadExact(Buffer, 0, 1); }
/// <summary> /// Common Test code to try and deserialize from a non-readable stream /// </summary> /// <param name="provider"> /// The provider to use to perform the serialization /// </param> public static void Deserialize_StreamNonReadable(SerializationProvider provider) { NonReadableStream stream = new NonReadableStream(); SerializableObject obj1 = provider.Deserialize <SerializableObject>(stream); }