public void GetSectionDataAsRawXml_ValidSection_Sucess() { // arrange ISectionXml testSection = this.CreateSectionMock( "plugins", this.xmlPluginsConfig, typeof( PluginsConfigXml ).FullName ); IModuleXml moduleMock = this.CreateModuleMock( "testModule", "NGin.Core.Test.NGinModuleConfigTest.TestModule", testSection ); NGinModuleConfig config = new NGinModuleConfig( moduleMock ); string expectedXml = config.GetSectionCloned( "plugins" ).XmlRaw; string resultXml = null; // act resultXml = config.GetSectionDataAsRawXml( "plugins" ); // assert Assert.IsNotNull( resultXml ); Assert.AreEqual( expectedXml, resultXml ); }
public void GetSectionDataAsRawXml_UnknownSection_RaiseArgumentException() { // arrange IModuleXml moduleMock = this.CreateModuleMock( "testModule", "NGin.Core.Test.NGinModuleConfigTest.TestModule" ); NGinModuleConfig config = new NGinModuleConfig( moduleMock ); string sectionName = Guid.NewGuid().ToString(); string resultXml = null; // act resultXml = config.GetSectionDataAsRawXml( sectionName ); // assert }