コード例 #1
0
        public void DefaultConversionCallback_ExtensionNotIHaveDefaultConversionCallback_ShouldUseDefault()
        {
            var extension = new Mock<IExtension>();

            var testee = new HaveDefaultConversionCallback(extension.Object);

            testee.DefaultConversionCallback.Should().BeOfType<DefaultConversionCallback>();
        }
コード例 #2
0
        public void DefaultConversionCallback_ExtensionIsIHaveDefaultConversionCallback_ShouldAcquireDefaultCallbackFromExtension()
        {
            var extension = new Mock<IExtension>();
            var consumer = extension.As<IHaveDefaultConversionCallback>();
            var expected = Mock.Of<IConversionCallback>();

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

            var testee = new HaveDefaultConversionCallback(extension.Object);
            testee.DefaultConversionCallback.Should().Be(expected);
        }