Пример #1
0
        public void SectionName_ExtensionNotIHaveExtensionConfigurationSectionName_ShouldUseTypeName()
        {
            var extension = new Mock <IExtension>();
            var expected  = extension.Object.GetType().Name;

            var testee = new HaveConfigurationSectionName(extension.Object);

            testee.SectionName.Should().Be(expected);
        }
Пример #2
0
        public void SectionName_ExtensionIHaveExtensionConfigurationSectionName_ShouldAcquireNameFromExtension()
        {
            var extension = new Mock <IExtension>();
            var namer     = extension.As <IHaveConfigurationSectionName>();

            namer.Setup(n => n.SectionName).Returns(AnyName);

            var testee = new HaveConfigurationSectionName(extension.Object);

            testee.SectionName.Should().Be(AnyName);
        }
        public void SectionName_ExtensionIHaveExtensionConfigurationSectionName_ShouldAcquireNameFromExtension()
        {
            var extension = A.Fake <IExtension>(builder => builder.Implements(typeof(IHaveConfigurationSectionName)));
            var namer     = extension as IHaveConfigurationSectionName;

            A.CallTo(() => namer.SectionName).Returns(AnyName);

            var testee = new HaveConfigurationSectionName(extension);

            testee.SectionName.Should().Be(AnyName);
        }