Repository navigation
Description
Description
ExpectedConcreteClasses in SysML2.NET.CodeGenerator.Tests/Expected/ExpectedClasses.cs is the set of classes whose generated output every UML generator fixture compares against an expected file. The uml4net model inspector selects the "interesting classes" that together cover every variation of types, multiplicities and subsetted/redefined properties. The list should contain all of the concrete ones. Today it holds 19 of the 37.
The report is produced by SysML2.NET.CodeGenerator.Tests/Inspector/UmlModelInspectorTestFixture.cs (Verify_that_Inspection_report_can_be_generated). It writes uml-inspection-report.txt to the test output directory and lists the classes under INTERESTING CLASSIFIERS. All 19 classes already in ExpectedConcreteClasses are among the report's picks.
Missing concrete classes
| Model | Classes |
|---|---|
| SysML | AcceptActionUsage, AttributeUsage, CalculationUsage, CaseUsage, ConjugatedPortDefinition, ConjugatedPortTyping, ConnectionUsage, InterfaceUsage, OccurrenceUsage, TriggerInvocationExpression, VariantMembership, VerificationCaseDefinition, ViewpointDefinition |
| KerML | Annotation, BooleanExpression, Connector, FeatureValue, Namespace |
The report also lists the abstract Element and Relationship. They belong in ExpectedAllClasses, not ExpectedConcreteClasses.
Scope
- Add the 18 classes to
ExpectedConcreteClasses, and checkExpectedAllClassesagainst the report as well. - Add the matching expected files for every fixture that uses
[TestCaseSource(typeof(ExpectedConcreteClasses))]: DTO, POCO, DTO comparer, JSON (de)serializer, XMI reader/writer, MessagePack, DAL factory/extensions, POCO reference-resolve and the Core DTO validator ([Feature]: Core DTO validator #406, PR Core dto validator is added. #445). - Optional: a test that compares the inspector's interesting concrete classes with
ExpectedConcreteClasses, so the list cannot drift from the report again.
Why it matters
Golden-file tests compare only the classes on the list. For example, ConjugatedPortDefinition and ConjugatedPortTyping cover two cases in the Core DTO validator generator:
- a required derived property (
ownedPortConjugator) that raises the lower bound of a stored one; - a non-derived redefinition (
conjugatedPortDefinitionredefinesFeatureTyping::type).
Today no expected file pins either case.
Activity