示例#1
0
        // This test runs and passes but it's very time-consuming.
        //[Fact]
        public void CorrectlyFindsLastKey()
        {
            var sut = new KeyFinder();

            var keys = sut.Find("abc", initialKeyspace: 0, keyCount: 64);

            Assert.Equal(22728, keys[63]);
        }
示例#2
0
        public void CorrectlyFindsFirstKey()
        {
            var sut = new KeyFinder();

            var keys = sut.Find("abc", initialKeyspace: 0, keyCount: 1);

            Assert.Equal(39, keys[0]);
        }
示例#3
0
        public void KeyspaceRange_IsExclusive()
        {
            var sut = new KeyFinder();

            var keys = sut.Find("abc", initialKeyspace: 0, keyspaceRangeExclusive: 92);

            Assert.Equal(1, keys.Count());
            Assert.Equal(39, keys[0]);
        }
示例#4
0
        public void StopsLookingForKeys_WhenKeyspaceExhausted_RegardlessOfKeysFound()
        {
            var sut = new KeyFinder();

            var keys = sut.Find("abc", initialKeyspace: 0, keyCount: 64, keyspaceRangeExclusive: 93);

            Assert.Equal(2, keys.Count());
            Assert.Equal(39, keys[0]);
            Assert.Equal(92, keys[1]);
        }