public void TryConvert_NullConverter_ThrowsArgumentNullException()
        {
            var policy = new DelegateConversionPolicy();

            IPropertyToken token;

            Assert.Throws <ArgumentNullException>(() => policy.TryConvert(null, null, out token));
        }
        public void TryConvert_Object_ReturnsFalse()
        {
            var converter = Mock.Of <IPropertyConverter>();
            var policy    = new DelegateConversionPolicy();

            IPropertyToken token;

            Assert.False(policy.TryConvert(converter, new object(), out token));
        }
        public void TryConvert_Delegate_ReturnsScalarToken()
        {
            Action <string> action    = Console.WriteLine;
            var             converter = Mock.Of <IPropertyConverter>();
            var             policy    = new DelegateConversionPolicy();

            IPropertyToken token;

            Assert.True(policy.TryConvert(converter, action, out token));

            var scalar = token as ScalarToken;

            Assert.NotNull(scalar);

            string value = scalar.Value as string;

            Assert.NotNull(value);
            Assert.True(value.Contains(nameof(Console.WriteLine)));
        }