iTwin / imodel-transformer

API for exporting an iModel's parts and also importing them into another iModel
MIT License
3 stars 2 forks source link

Investigate having more structured testing with a case matrix #155

Open nick4598 opened 4 months ago

nick4598 commented 4 months ago

BranchProvenanceInitializer.test.ts already does this to an extent with sourceTargetFedGuidToAspectCountMap and the way the test cases are generated.

A lot of test cases in IModelTransformerHub.test.ts and IModelTransformer.test.ts and may have some overlap in terms of what scenarios they test, and its hard to currently tell what all is being tested with the way they are currently setup.

A good starting point may be to take a look at the following 3 test cases: it("should be able to handle relationship delete using new relationship provenance method with no fedguids" it("should be able to handle relationship delete using old relationship provenance method with no fedguids" it("should be able to handle relationship delete using fedguids"

and generate them programmatically. This may need to be more complex than how it is done in BranchProvenanceInitializer.test.ts, perhaps we need to create a new class 'Case' which captures certain options that need to be set for the transformer in certain test cases. An example of this is we need to toggle 'forceOldRelationshipProvenanceMethod' for the above 3 test cases, but we probably don't need to toggle this for any of the other 90+ test cases which currently run.