Пример #1
0
 public void IndexToChar()
 {
     VaultGraph.FromIndex(VaultGraph.ToIndex('0')).ShouldBe('0');
     VaultGraph.FromIndex(VaultGraph.ToIndex('9')).ShouldBe('9');
     VaultGraph.FromIndex(VaultGraph.ToIndex('A')).ShouldBe('A');
     VaultGraph.FromIndex(VaultGraph.ToIndex('Z')).ShouldBe('Z');
     VaultGraph.FromIndex(VaultGraph.ToIndex('a')).ShouldBe('a');
     VaultGraph.FromIndex(VaultGraph.ToIndex('z')).ShouldBe('z');
 }
Пример #2
0
        public void CharToIndex()
        {
            var i0 = VaultGraph.ToIndex('0');
            var i9 = VaultGraph.ToIndex('9');
            var iA = VaultGraph.ToIndex('A');
            var iZ = VaultGraph.ToIndex('Z');
            var ia = VaultGraph.ToIndex('a');
            var iz = VaultGraph.ToIndex('z');

            i0.ShouldBe(0);
            i9.ShouldBe(iA - 1);
            iZ.ShouldBe(ia - 1);
            iz.ShouldBe(10 + 26 + 26 - 1);
        }