Esempio n. 1
0
        public void IsValid_WhenMatchingKeyAndBucketingKeyAreNull_ReturnsFalse()
        {
            // Arrange.
            var key    = new Key(null, null);
            var method = "Test";

            // Act.
            var result = keyValidator.IsValid(key, method);

            // Assert.
            Assert.IsFalse(result);
            _log.Verify(mock => mock.Error($"{method}: you passed a null matchingKey, the matchingKey must be a non-empty string."), Times.Once());
            _log.Verify(mock => mock.Error($"{method}: you passed a null bucketingKey, the bucketingKey must be a non-empty string."), Times.Once());
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            while (true)
            {
                string key = KeyGenerator.Generate();

                Console.WriteLine(key);
                Console.WriteLine(KeyValidator.IsValid(key));

                if (Console.ReadKey().Key == ConsoleKey.Escape)
                {
                    return;
                }
            }
        }