public async Task LoadIntoBufferAsync_ContentLengthSmallerThanActualData_ActualDataLargerThanMaxSize_ThrowsException( int numberOfWrites, int sizeOfEachWrite, int reportedLength, int maxSize) { Assert.InRange(maxSize, 1, (numberOfWrites * sizeOfEachWrite) - 1); LieAboutLengthContent c = new LieAboutLengthContent(numberOfWrites, sizeOfEachWrite, reportedLength); Task t = c.LoadIntoBufferAsync(maxSize); await Assert.ThrowsAsync <HttpRequestException>(() => t); }
public async Task LoadIntoBufferAsync_ContentLengthSmallerThanActualData_ActualDataLargerThanMaxSize_ThrowsException( int numberOfWrites, int sizeOfEachWrite, int reportedLength, int maxSize) { Assert.InRange(maxSize, 1, (numberOfWrites * sizeOfEachWrite) - 1); LieAboutLengthContent c = new LieAboutLengthContent(numberOfWrites, sizeOfEachWrite, reportedLength); Task t = c.LoadIntoBufferAsync(maxSize); await Assert.ThrowsAsync<HttpRequestException>(() => t); }