Beispiel #1
0
        public void Should_support_nested_increments()
        {
            SequenceNumber number = new SequenceNumber();

            Assert.That(number.Next(), Is.EqualTo(1));

            Assert.That(number.Of <A>().Next(), Is.EqualTo(1));

            Assert.That(number.Of <A>().Of <B>().Next(), Is.EqualTo(1));

            Assert.That(number.Of <A>().Next(), Is.EqualTo(2));

            Assert.That(number.Of <A>().Of <B>().Next(), Is.EqualTo(1));

            Assert.That(number.Next(), Is.EqualTo(2));

            Assert.That(number.Of <A>().Next(), Is.EqualTo(1));
        }