static void Main(string[] args)
        {
            var sequence  = new Sequence(new [] { '0', '1' });
            var generator = new UniqueIdentifierGenerator(sequence);

            for (var i = 0; i < 16; i++)
            {
                Console.WriteLine(generator.GetNext());
            }

            Console.ReadLine();
        }
        public void ShouldGenerateBinaryStringProperly()
        {
            var sequence = new Sequence(new [] { '0', '1' });

            _systemUnderTest = new UniqueIdentifierGenerator(sequence, true);

            // Jump to 8 in binary
            for (var i = 0; i < 7; i++)
            {
                _systemUnderTest.GetNext();
            }

            _systemUnderTest.GetNext().Should().Be("1000");

            // Jump to 1024 in binary
            for (var i = 0; i < 1015; i++)
            {
                _systemUnderTest.GetNext();
            }

            _systemUnderTest.GetNext().Should().Be("10000000000");
        }
        public void ShouldWrapProperly()
        {
            _systemUnderTest = new UniqueIdentifierGenerator(Sequence.LowerCaseSequence(), "z");
            _systemUnderTest.GetNext().Should().Be("aa");

            _systemUnderTest = new UniqueIdentifierGenerator(Sequence.LowerCaseSequence(), "zz");
            _systemUnderTest.GetNext().Should().Be("aaa");

            _systemUnderTest = new UniqueIdentifierGenerator(Sequence.LowerCaseSequence(), "zzz");
            _systemUnderTest.GetNext().Should().Be("aaaa");

            // Etc...
        }
 public void ShouldIncrementProperly()
 {
     _systemUnderTest = new UniqueIdentifierGenerator(Sequence.LowerCaseSequence(), "a");
     _systemUnderTest.GetNext().Should().Be("b");
     _systemUnderTest.GetNext().Should().Be("c");
     _systemUnderTest.GetNext().Should().Be("d");
     _systemUnderTest.GetNext().Should().Be("e");
     _systemUnderTest.GetNext().Should().Be("f");
     _systemUnderTest.GetNext().Should().Be("g");
 }
        public void ShouldWorkWithCustomSequence()
        {
            var sequence = new Sequence(new [] { 'a', 'b' });

            _systemUnderTest = new UniqueIdentifierGenerator(sequence, "a");
            _systemUnderTest.GetNext().Should().Be("b");
            _systemUnderTest.GetNext().Should().Be("aa");
            _systemUnderTest.GetNext().Should().Be("ab");
            _systemUnderTest.GetNext().Should().Be("ba");
            _systemUnderTest.GetNext().Should().Be("bb");
            _systemUnderTest.GetNext().Should().Be("aaa");
        }