test: add V1_3_15 XML roundtrip tests for 33 missing models#56
Open
test: add V1_3_15 XML roundtrip tests for 33 missing models#56
Conversation
Add comprehensive roundtrip tests for V1_3_15 XML parsing covering: - String types: ActionStrings, CompanionStrings, VoiceStrings, WorldLoreStrings, CommentOnActionStrings, ModuleStrings - Simple entities: Bandits, Caravans, ConversationAnimations, MeetingScenes, SkeletonScales, SPBattleScenes - Medium complexity: CommentStrings, ConceptStrings, ConversationScenes, PartyTemplates, TraitStrings, ObsoleteCharacters - Medium lists: SandboxBodyProperties, SandboxCheats, SandboxSkillSets, SettlementTrackInstruments, SettlementTracks, SPProjects - Complex nested: EducationEquipmentTemplates, SandboxEquipmentSets, EducationCharacterTemplates, Heroes, LocationComplexTemplates - Complex with many attributes: SPGenericCharacters, SpKingdoms, SPSpecialCharacters, SPWorkshops Each test verifies XML deserialize/serialize roundtrip preserves data exactly.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds missing XML roundtrip tests for Bannerlord v1.3.15 model types in BannerlordModEditor.Common.Tests, expanding coverage to ensure deserialization + serialization preserves the XML structure for more shipped game data files.
Changes:
- Added 33 new v1.3.15 roundtrip test classes under
BannerlordModEditor.Common.Tests/Models/V1_3_15/. - Each test loads the corresponding XML from
TestData/V1_3_15, deserializes into the model, serializes back, and asserts structural equivalence viaXmlTestUtils.AreStructurallyEqual.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| BannerlordModEditor.Common.Tests/Models/V1_3_15/ActionStringsRoundtripTests.cs | Adds roundtrip coverage for action_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/BanditsRoundtripTests.cs | Adds roundtrip coverage for bandits.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/CaravansRoundtripTests.cs | Adds roundtrip coverage for caravans.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/CommentOnActionStringsRoundtripTests.cs | Adds roundtrip coverage for comment_on_action_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/CommentStringsRoundtripTests.cs | Adds roundtrip coverage for comment_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/CompanionStringsRoundtripTests.cs | Adds roundtrip coverage for companion_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/ConceptStringsRoundtripTests.cs | Adds roundtrip coverage for concept_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/ConversationAnimationsRoundtripTests.cs | Adds roundtrip coverage for conversation_animations.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/ConversationScenesRoundtripTests.cs | Adds roundtrip coverage for conversation_scenes.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/EducationCharacterTemplatesRoundtripTests.cs | Adds roundtrip coverage for education_character_templates.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/EducationEquipmentTemplatesRoundtripTests.cs | Adds roundtrip coverage for education_equipment_templates.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/HeroesRoundtripTests.cs | Adds roundtrip coverage for heroes.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/LocationComplexTemplatesRoundtripTests.cs | Adds roundtrip coverage for location_complex_templates.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/MeetingScenesRoundtripTests.cs | Adds roundtrip coverage for meeting_scenes.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/ModuleStringsRoundtripTests.cs | Adds roundtrip coverage for module_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/ObsoleteCharactersRoundtripTests.cs | Adds roundtrip coverage for obsolete_characters.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/PartyTemplatesRoundtripTests.cs | Adds roundtrip coverage for partyTemplates.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SandboxBodyPropertiesRoundtripTests.cs | Adds roundtrip coverage for sandbox_bodyproperties.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SandboxCheatsRoundtripTests.cs | Adds roundtrip coverage for sandbox_cheats.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SandboxEquipmentSetsRoundtripTests.cs | Adds roundtrip coverage for sandbox_equipment_sets.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SandboxSkillSetsRoundtripTests.cs | Adds roundtrip coverage for sandbox_skill_sets.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SettlementTrackInstrumentsRoundtripTests.cs | Adds roundtrip coverage for settlement_track_instruments.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SettlementTracksRoundtripTests.cs | Adds roundtrip coverage for settlement_tracks.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SkeletonScalesRoundtripTests.cs | Adds roundtrip coverage for skeleton_scales.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SPBattleScenesRoundtripTests.cs | Adds roundtrip coverage for sp_battle_scenes.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SPGenericCharactersRoundtripTests.cs | Adds roundtrip coverage for spgenericcharacters.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SpKingdomsRoundtripTests.cs | Adds roundtrip coverage for spkingdoms.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SPProjectsRoundtripTests.cs | Adds roundtrip coverage for spprojects.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SPSpecialCharactersRoundtripTests.cs | Adds roundtrip coverage for spspecialcharacters.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/SPWorkshopsRoundtripTests.cs | Adds roundtrip coverage for spworkshops.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/TraitStringsRoundtripTests.cs | Adds roundtrip coverage for trait_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/VoiceStringsRoundtripTests.cs | Adds roundtrip coverage for voice_strings.xml. |
| BannerlordModEditor.Common.Tests/Models/V1_3_15/WorldLoreStringsRoundtripTests.cs | Adds roundtrip coverage for world_lore_strings.xml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 10 commits
March 22, 2026 14:35
Fixed XmlRoot mismatches causing 16 test failures: - SkeletonScales: SkeletonScales -> Scales - Heroes: Characters -> Heroes - Bandits: BanditFactions -> NPCCharacters - Caravans: Caravans -> NPCCharacters - CommentOnActionStrings: base -> strings - CommentStrings: base -> strings - CompanionStrings: base -> strings - ConceptStrings: base -> Concepts - ModuleStrings: base -> strings - TraitStrings: base -> strings - VoiceStrings: base -> strings - WorldLoreStrings: base -> strings - SPBattleScenes: Scenes -> SPBattleScenes
- SandboxBodyProperties: BodyPropertiesMin -> BodyProperties - PartyTemplates: PartyTemplates -> partyTemplates
- PartyTemplates: XML uses MBPartyTemplate/stacks/PartyTemplateStack (not PartyTemplate/Roles) - Heroes: XML uses <Hero> with alive/faction/text/father attributes (not <Character>) - Bandits: Use shared NPCCharacter model with full nested content support - Caravans: Use shared NPCCharacter model with is_hero/is_mercenary attributes - ConceptStrings: XML uses <Concept> not <string> - ConversationAnimations: XML uses IdleAnim/Reaction not Animation - SPGenericCharacters: Refactored to use shared NPCCharacter from SharedNPCCharacters.cs - SharedNPCCharacters: New shared model for NPCCharacter with BodyProperties, hair_tags etc.
…now shared with Lords.cs)
…->Heroes, BanditFactions->Bandits)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BannerlordModEditor.Common.Tests/Models/V1_3_15/Game Source XML Parsing Locations
Each XML type is parsed by specific classes in the Bannerlord v1.3.15 game source. Key deserialization patterns:
MBObjectBase, overrideDeserialize(MBObjectManager, XmlNode), registered viaRegisterType<T>()in Campaign/GameOnRegisterTypes()GameTextManager.LoadFromXML()in TaleWorlds.Core (custom string table format)Load*()methodsXmlDocument.Load()in dedicated loader classesKey Registration Locations
Tests Added
Verification
881f9ccNETSDK1018) unrelated to these changes