Example #1
0
        public void CloneSectionWithData_SectionNull_RaiseArgumentNullException()
        {
            // arrange
            IModuleXml moduleMock = this.CreateModuleMock( "testModule", "NGin.Core.Test.NGinModuleConfigTest.TestModule" );
            NGinModuleConfig config = new NGinModuleConfig( moduleMock );
            ISectionXml sectionNull = null;

            // act
            config.CloneSectionWithData( sectionNull );

            // assert
        }
Example #2
0
        public void CloneSectionWithData_ValidSection_DataValid()
        {
            // 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 );
            ISectionXml section = config.GetSectionCloned( "plugins" );
            ISectionXml clone = null;

            // act
            clone = config.CloneSectionWithData( section );

            // assert
            Assert.IsNotNull( clone );
            Assert.IsInstanceOf<ISectionXml>( clone );
            Assert.AreNotSame( section, clone );
            Assert.AreEqual( section, clone );
        }