Esempio n. 1
0
        public void GetSectionDataAsXmlElement_ValidSection_Success()
        {
            // arrange
            string sectionName = "dependencies";
            ISectionXml testSection = this.CreateSectionMock( sectionName, this.xmlDependenciesConfig, typeof( DependenciesConfigXml ).FullName );
            IModuleXml moduleMock = this.CreateModuleMock( "testModule", "NGin.Core.Test.NGinModuleConfigTest.TestModule", testSection );
            NGinModuleConfig config = new NGinModuleConfig( moduleMock );
            XmlElement expectedXml = config.GetSectionCloned( sectionName ).XmlElement;
            XmlElement resultXml = null;

            // act
            resultXml = config.GetSectionDataAsXmlElement( sectionName );

            // assert
            Assert.IsNotNull( resultXml );
            Assert.AreEqual( expectedXml, resultXml );
        }
Esempio n. 2
0
        public void GetSectionDataAsXmlElement_InvalidSection_RaiseArgumentException()
        {
            // arrange
            IModuleXml moduleMock = this.CreateModuleMock( "testModule", "NGin.Core.Test.NGinModuleConfigTest.TestModule" );
            NGinModuleConfig config = new NGinModuleConfig( moduleMock );
            string sectionName = Guid.NewGuid().ToString();
            XmlElement resultXml = null;

            // act
            resultXml = config.GetSectionDataAsXmlElement( sectionName );

            // assert
        }