public async Task xxHash_Implementation_ComputeHashAsync_HashSizeInBits_MagicallyInvalid_Throws() { var xxHashConfigMock = new Mock <IxxHashConfig>(); { var readCount = 0; xxHashConfigMock.SetupGet(xhc => xhc.HashSizeInBits) .Returns(() => { readCount += 1; if (readCount == 1) { return(32); } return(33); }); xxHashConfigMock.Setup(xhc => xhc.Clone()) .Returns(() => xxHashConfigMock.Object); } var xxHash = new xxHash_Implementation(xxHashConfigMock.Object); using (var memoryStream = new MemoryStream(new byte[1])) { await Assert.ThrowsAsync <NotImplementedException>( () => xxHash.ComputeHashAsync(memoryStream)); } }
public void xxHash_Implementation_ComputeHash_HashSizeInBits_MagicallyInvalid_Throws() { var xxHashConfigMock = new Mock <IxxHashConfig>(); { var readCount = 0; xxHashConfigMock.SetupGet(xhc => xhc.HashSizeInBits) .Returns(() => { readCount += 1; if (readCount == 1) { return(32); } return(33); }); xxHashConfigMock.Setup(xhc => xhc.Clone()) .Returns(() => xxHashConfigMock.Object); } var xxHash = new xxHash_Implementation(xxHashConfigMock.Object); Assert.Throws <NotImplementedException>( () => xxHash.ComputeHash(new byte[1])); }