6.0 KiB
6.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T04:31:55.181756+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 6aa688c6b66d13f9 |
TestMetaData
Documentation: Test Metadata Wrappers Module
1. Purpose
This module provides thin managed wrappers around low-level ISO.* data entities (LabratoryDetails, CustomerDetails, TestEngineerDetails) to support database import operations within the DataPRO system. It exposes simplified, namespaced access to metadata entities used during test configuration and reporting, including CRUD-like operations (e.g., DeleteAll) and instance management (e.g., singleton list for engineers). The module exists to decouple the import pipeline from direct dependencies on the ISO layer, enabling testability and future flexibility in metadata handling.
2. Public Interface
LabratoryDetails
public string Name { get; set; }
Gets or sets the laboratory name by delegating to the underlying_lab.Namefield.
LabratoryDetailsList
public static void DeleteAll()
InvokesISO.LabratoryDetails.DeleteLabratoryDetails()to remove all laboratory detail records from persistent storage.
CustomerDetails
public string Name { get; set; }
Gets or sets the customer name by delegating to_customerDetails.Name.
CustomerDetailsList
public static void DeleteAll()
InvokesISO.CustomerDetails.DeleteCustomerDetails()to delete all customer detail records.
TestEngineerDetails
public TestEngineerDetails()
Default constructor initializes_testEngineerDetailsto a newISO.TestEngineerDetailsinstance withNameset to"(none)".public TestEngineerDetails(ISO.TestEngineerDetails testEngineerDetails)
Copy constructor: initializes_testEngineerDetailsby constructing a newISO.TestEngineerDetailsfrom the provided instance.public string Name { get; set; }
Gets or sets the engineer’s name via_testEngineerDetails.Name.
TestEngineerDetailsList
public static TestEngineerDetailsList TestEngineerList { get; }
Static singleton accessor for the singleTestEngineerDetailsListinstance.public void ReloadAll()
Thread-safely repopulates the internal_testEngineersdictionary by callingGetAllTestEngineers()and caching entries keyed byName.public static void DeleteAll()
Clears the in-memory_testEngineersdictionary and invokesISO.TestEngineerDetails.DeleteAllTestEngineerDetails()to purge persisted records.private TestEngineerDetails[] GetAllTestEngineers()
Returns an array ofTestEngineerDetailsobjects: first a sentinel"(none)"entry (via default constructor), then one entry per record returned byISO.TestEngineerDetails.GetAllTestEngineerDetails().
Note
:
GetAllTestEngineers()isprivate, but used internally byReloadAll()and implicitly by thePopulateEngineers()method.
3. Invariants
Nameis the only mutable property exposed via the public interface for all three detail classes (LabratoryDetails,CustomerDetails,TestEngineerDetails).TestEngineerDetailsListis a singleton — only one instance exists (_testEngineerList), accessed viaTestEngineerList.- Thread safety for
ReloadAll()is enforced vialock (_testEngineerLock)aroundPopulateEngineers(). "(none)"sentinel entry is always the first element in the list returned byGetAllTestEngineers().- Duplicate names are prevented in
_testEngineersdictionary:PopulateEngineers()only adds an entry if!_testEngineers.ContainsKey(t.Name). _testEngineersis nullified onDeleteAll(), forcing a full reload on next access.
4. Dependencies
Dependencies of this module:
ISO.LabratoryDetails(type with static methodsDeleteLabratoryDetails())ISO.CustomerDetails(type with static methodDeleteCustomerDetails())ISO.TestEngineerDetails(type with static methodsGetAllTestEngineerDetails(),DeleteAllTestEngineerDetails(), and constructors)System.Collections.Generic.Dictionary<string, TestEngineerDetails>(used inTestEngineerDetailsList)
Dependencies on this module:
- Not explicitly stated in source, but given the naming and structure, this module is likely consumed by:
DatabaseImportpipeline components (e.g., importers that populate or validate test metadata).- UI or service layers that require test metadata (e.g., selecting engineer or lab for a test run).
5. Gotchas
- Typo in class names: All classes use
Labratory(misspelled) instead ofLaboratory. This is preserved from the underlyingISOlayer and must be maintained for compatibility. TestEngineerDetailsis not thread-safe for concurrent mutation — whileReloadAll()is synchronized, direct access to_testEngineerDetails.Name(viaNameproperty) is not guarded._testEngineerDetailsfield inTestEngineerDetailsis notreadonly, unlike the others — implying potential reassignment (though not observed in current code).GetAllTestEngineers()silently ignores duplicate names — only the first occurrence is retained in_testEngineers.- No validation on
Namevalues — empty strings or duplicates are allowed at the wrapper level (though duplicates are deduped inTestEngineerDetailsList). CustomerDetailsListandLabratoryDetailsListhave no instance members beyondDeleteAll()— they are effectively static namespaces.TestEngineerDetailsListcaches in-memory state — changes made directly toISO.*entities outside this module may not be reflected untilReloadAll()is called.
None identified beyond those above.