예제 #1
0
        public void can_pad_with_zero()
        {
            var g = new FakeRefNumberGenerator(_customers, 4);

            g.FakeNumber = 1;
            var s = g.GenerateForCustomer();

            Assert.That(s, Is.EqualTo("010001"));
        }
예제 #2
0
        public void can_solve_conflicts()
        {
            var u1 = new Customer()
            {
                Name = "UserOne", RefNumber = "010001"
            };

            _customers.Save(u1);

            var g = new FakeRefNumberGenerator(_customers, 4);

            g.FakeNumber = 1;
            var s = g.GenerateForCustomer();

            Assert.That(s, Is.EqualTo("010002"));
        }