fix #1707: совместимость и обработка ошибок в ЗаписатьТипДокумента#1709
fix #1707: совместимость и обработка ошибок в ЗаписатьТипДокумента#1709Mr-Rm wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughWriteDocumentType in XmlWriterImpl.cs adds argument validation, normalizes optional parameters, and remaps writer exceptions to new RuntimeException factory methods (WrongOrderException, NoSystemIdException). Corresponding test cases and procedures are added in xmlwrite.os to verify success and error scenarios. ChangesXML DocType Validation
Estimated code review effort: 2 (Simple) | ~12 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/xmlwrite.os (1)
834-886: 📐 Maintainability & Code Quality | 🔵 TrivialConsider extracting the repeated try/catch/assert pattern.
The three error tests (
_4ПараметраСОшибкой,_ОшибкаПослеНачала,_ОшибкаИмени) share an identical try/catch/Найти/ПроверитьИстинуstructure, differing only in the setup call and expected substring. A small helper taking a setup procedure/parameters and expected substring would reduce duplication.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/xmlwrite.os` around lines 834 - 886, The three error tests in ТестДолжен_ПроверитьЗаписьТипаДокумента_* repeat the same try/catch, Найти, and ПроверитьИстину flow, so extract that pattern into a small helper. Add a reusable test helper that accepts the setup action for ЗаписьXML and the expected error substring, then have ТестДолжен_ПроверитьЗаписьТипаДокумента_4ПараметраСОшибкой, ТестДолжен_ПроверитьЗаписьТипаДокумента_ОшибкаПослеНачала, and ТестДолжен_ПроверитьЗаписьТипаДокумента_ОшибкаИмени call it with only their differing setup and expectation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/xmlwrite.os`:
- Around line 834-886: The three error tests in
ТестДолжен_ПроверитьЗаписьТипаДокумента_* repeat the same try/catch, Найти, and
ПроверитьИстину flow, so extract that pattern into a small helper. Add a
reusable test helper that accepts the setup action for ЗаписьXML and the
expected error substring, then have
ТестДолжен_ПроверитьЗаписьТипаДокумента_4ПараметраСОшибкой,
ТестДолжен_ПроверитьЗаписьТипаДокумента_ОшибкаПослеНачала, and
ТестДолжен_ПроверитьЗаписьТипаДокумента_ОшибкаИмени call it with only their
differing setup and expectation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 48f02c09-3b1f-43ea-82e9-5e7b810764ba
📒 Files selected for processing (2)
src/OneScript.StandardLibrary/Xml/XmlWriterImpl.cstests/xmlwrite.os
Осталось отличие - нет пробела между
"и[Summary by CodeRabbit
Bug Fixes
Tests