public async Task StreamComparisonTestsAsync(string streamA, string streamB, int[] maxStreamABytesReturnedEachCall, int[] maxStreamBBytesReturnedEachCall, int bufferSize) { byte[] streamABytes = Convert.FromBase64String(streamA); byte[] streamBBytes = Convert.FromBase64String(streamB); FakeStream fakeStreamA = new FakeStream(streamABytes, maxStreamABytesReturnedEachCall); FakeStream fakeStreamB = new FakeStream(streamBBytes, maxStreamBBytesReturnedEachCall); Assert.Equal(streamA == streamB, await GeneralUtils.CompareStreamsAsync(fakeStreamA, fakeStreamB, bufferSize)); }
public async Task StreamComparisonTestsAsync(string streamA, string streamB, int[] maxStreamABytesReturnedEachCall, int[] maxStreamBBytesReturnedEachCall, int bufferSize) { byte[] streamABytes = Convert.FromBase64String(streamA); byte[] streamBBytes = Convert.FromBase64String(streamB); FakeStream fakeStreamA = new FakeStream(streamABytes, maxStreamABytesReturnedEachCall); FakeStream fakeStreamB = new FakeStream(streamBBytes, maxStreamBBytesReturnedEachCall); bool streamsShouldBeSame = streamA == streamB; bool streamsAreSame = await GeneralUtils.CompareStreamsAsync(fakeStreamA, fakeStreamB, bufferSize); streamsAreSame.Should().Be(streamsShouldBeSame, "Stream comparison failed"); }