Пример #1
0
        public void TestTryGet(string key, DateTime value)
        {
            // Arrange
            _sut.Add(key, value);
            DateTime output;

            // Act
            var result = _sut.TryGet(key, out output);

            // Assert
            Assert.IsTrue(result, "Correct result");
            Assert.AreEqual(value, output, "Correct output");
        }
Пример #2
0
        public bool TryGetTypeConfiguration(Type type, out HalJsonTypeConfiguration config)
        {
            var rv = _config.TryGet(type, out config);

            if (!rv && AttributeConfigurationResolver.GetConfigurationOrNull(type) != null)         // No configuration in cache, but found attribute-based one
            {
                config = GetOrCreateTypeConfiguration(type);
                return(true);
            }
            return(rv);
        }