public void Test_GetTypedValue()
        {
            const string prefix = "SomePrefix";
            const string key = "key";
            
            var mock = new Mock<IConfigurationNode>(MockBehavior.Strict);
            mock.Setup(m => m.GetValue<bool>($"{prefix}:{key}")).Returns(true);

            var instance = new PrefixConfigurationNode(mock.Object, prefix);

            Assert.Equal(true, instance.GetValue<bool>(key));

            mock.Verify(m => m.GetValue<bool>(It.IsAny<string>()), Times.Once());
        }
Exemple #2
0
        public void Test_GetTypedValue()
        {
            const string prefix = "SomePrefix";
            const string key    = "key";

            var mock = new Mock <IConfigurationNode>(MockBehavior.Strict);

            mock.Setup(m => m.GetValue <bool>($"{prefix}:{key}")).Returns(true);

            var instance = new PrefixConfigurationNode(mock.Object, prefix);

            Assert.Equal(true, instance.GetValue <bool>(key));

            mock.Verify(m => m.GetValue <bool>(It.IsAny <string>()), Times.Once());
        }