public void ConversionCallbacks_ExtensionNotIHaveConversionCallbacks_ShouldUseEmptyOne()
        {
            var extension = new Mock<IExtension>();

            var testee = new HaveConversionCallbacks(extension.Object);
            testee.ConversionCallbacks.Should().BeEmpty();
        }
        public void DefaultConversionCallback_ExtensionNotIHaveConversionCallbacks_ShouldUseEmptyOne()
        {
            var extension = new Mock<IExtension>();

            var testee = new HaveConversionCallbacks(extension.Object);

            testee.DefaultConversionCallback.Should().Be(HaveConversionCallbacks.DefaultCallback);
        }
        public void DefaultConversionCallback_ExtensionIsIHaveConversionCallbacks_ShouldAcquireDefaultCallbackFromExtension()
        {
            var extension = new Mock<IExtension>();
            var consumer = extension.As<IHaveConversionCallbacks>();
            Func<string, PropertyInfo, object> expected = (value, info) => new object();

            consumer.Setup(n => n.DefaultConversionCallback).Returns(expected);

            var testee = new HaveConversionCallbacks(extension.Object);
            testee.DefaultConversionCallback.Should().Be(expected);
        }
        public void ConversionCallbacks_ExtensionIsIHaveConversionCallbacks_ShouldAcquireCallbacksFromExtension()
        {
            var extension = new Mock<IExtension>();
            var consumer = extension.As<IHaveConversionCallbacks>();
            var expected = new KeyValuePair<string, Func<string, PropertyInfo, object>>("Value", (value, info) => new object());

            consumer.Setup(n => n.ConversionCallbacks).Returns(new Dictionary<string, Func<string, PropertyInfo, object>> { { expected.Key, expected.Value } });

            var testee = new HaveConversionCallbacks(extension.Object);
            testee.ConversionCallbacks.Should().Contain(expected);
        }