private IModuleXml CreateModuleMock( string moduleName, string typeFullName, params ISectionXml[] sections ) { ModuleXml result = new ModuleXml(); // stub properties result.Name = moduleName; result.Type = typeFullName; result.Sections = new System.Collections.ObjectModel.Collection<SectionXml>(); // stub sections foreach ( ISectionXml section in sections ) { result.Sections.Add( section as SectionXml ); } return result; }
object ICloneable.Clone() { ModuleXml result = new ModuleXml(); // copy properties result.Name = this.Name; result.Type = this.Type; // copy sections foreach ( SectionXml section in this.Sections ) { result.Sections.Add( section.Clone() as SectionXml ); } return result; }