public void TestKeyReservation()
        {
            lock (_keyReservations)
            {
                _keyReservations.Clear();
                _prefixReservations.Clear();
            }
            Guid   reservation = Guid.NewGuid();
            string key         = "My test key";
            string key2        = LogContext.ReserveKey(key, reservation);

            Assert.AreEqual(key, key2);
            Guid r2;

            Assert.IsTrue(_keyReservations.TryGetValue(key, out r2));
            Assert.AreEqual(reservation, r2);
            string     value   = Tester.RandomGenerator.RandomString();
            LogContext context = new LogContext();

            context.Set(reservation, key, value);
            Assert.IsNotNull(context);
            string value2 = context.Get(key);

            Assert.AreEqual(value, value2);
        }
        public void TestKeyReservationErrors()
        {
            lock (_keyReservations)
            {
                _keyReservations.Clear();
                _prefixReservations.Clear();
            }
            Guid   reservation = Guid.NewGuid();
            string key         = Tester.RandomGenerator.RandomString(LogContext.MaximumKeyLength);
            string key2        = LogContext.ReserveKey(key, reservation);

            Assert.AreEqual(key, key2);
            Guid r2;

            Assert.IsTrue(_keyReservations.TryGetValue(key, out r2));
            Assert.AreEqual(reservation, r2);
            string     value   = Tester.RandomGenerator.RandomString();
            LogContext context = new LogContext();

            context.Set(key, value);
        }