Beispiel #1
0
        public async Task JenkinsLookup3_Implementation_ComputeHashAsync_HashSizeInBits_MagicallyInvalid_Throws()
        {
            var jenkinsLookupConfigMock = new Mock <IJenkinsLookup3Config>();
            {
                var readCount = 0;

                jenkinsLookupConfigMock.SetupGet(jlc => jlc.HashSizeInBits)
                .Returns(() => {
                    readCount += 1;

                    if (readCount == 1)
                    {
                        return(32);
                    }

                    return(33);
                });

                jenkinsLookupConfigMock.Setup(jlc => jlc.Clone())
                .Returns(() => jenkinsLookupConfigMock.Object);
            }


            var jenkinsLookup3 = new JenkinsLookup3_Implementation(jenkinsLookupConfigMock.Object);

            using (var memoryStream = new MemoryStream(new byte[1]))
            {
                await Assert.ThrowsAsync <NotImplementedException>(
                    () => jenkinsLookup3.ComputeHashAsync(memoryStream));
            }
        }