public void PasswordIsInvalidAfterOneMinuteAndOneSecond()
        {
            var dateTime          = new StubDateTime();
            var passwordGenerator = new OneTimePasswordGenerator(dateTime);

            const string userId = "User01";

            dateTime.SetNextDateTime(new DateTime(2016, 1, 1, 12, 00, 00));
            var password = passwordGenerator.GenerateFor(userId);

            dateTime.SetNextDateTime(new DateTime(2016, 1, 1, 12, 01, 01));
            Assert.That(passwordGenerator.Validate(userId, password), Is.False);
        }
        public void PasswordStillValidAfterTwentyNineSeconds()
        {
            var dateTime          = new StubDateTime();
            var passwordGenerator = new OneTimePasswordGenerator(dateTime);

            const string userId = "User01";

            dateTime.SetNextDateTime(new DateTime(2016, 1, 1, 12, 00, 00));
            var password = passwordGenerator.GenerateFor(userId);

            dateTime.SetNextDateTime(new DateTime(2016, 1, 1, 12, 00, 29));
            Assert.That(passwordGenerator.Validate(userId, password), Is.True);
        }