14 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:33:20.750893+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 9acc3ac2395ce04b |
TestMetaData
Documentation: Test Metadata Domain Models
1. Purpose
This module provides domain models for managing test-related metadata entities—specifically CustomerDetails, LabratoryDetails, and TestEngineerDetails—within the DataPROWin7 system. Each class wraps a corresponding low-level ISO-compliant data object (DTS.Common.ISO.*) and exposes a property-change-aware interface for UI binding and data entry. The module also provides static/list management classes (*DetailsList) for CRUD operations (create, read, delete, list) against persisted metadata, with special handling for caching in run-test scenarios (only for TestEngineerDetails). Its role is to abstract persistence and change tracking while enabling data binding in WPF UIs.
2. Public Interface
CustomerDetails (inherits BasePropertyChanged)
bool IsBlank()
Returnstrueif no property has been set since construction (initial state only).string Name { get; set; }
Gets/sets the display name of the customer. Setting triggers_blank = falseandOnPropertyChanged("Name").string CustomerName { get; set; }
Gets/sets the full customer name.string CustomerTestRefNumber { get; set; }
Gets/sets the customer’s test reference number.string ProjectRefNumber { get; set; }
Gets/sets the associated project reference number.string CustomerOrderNumber { get; set; }
Gets/sets the customer order number.string CustomerCostUnit { get; set; }
Gets/sets the cost center or unit.bool LocalOnly { get; }
Gets theLocalOnlyflag from the underlying ISO object.DateTime LastModified { get; }
Gets the last modification timestamp.string LastModifiedBy { get; }
Gets the user who last modified the record.int Version { get; }
Gets the version number of the record.bool HasBlankName()
ReturnstrueifNameequalsStringResources.TestTemplate_EmptyListName.CustomerDetails()
Default constructor: initializes_customerDetailswith a newDTS.Common.ISO.CustomerDetails, setsNametoTestTemplate_EmptyListName, and_blank = true.CustomerDetails(DTS.Common.ISO.CustomerDetails customerDetails)
Wraps an existing ISO object; sets_blank = false.DTS.Common.ISO.CustomerDetails GetISOCustomer()
Returns the underlying ISO object.override string ToString()
ReturnsName.
CustomerDetailsList
static void Delete(CustomerDetails customer)
Callscustomer.GetISOCustomer().Delete(currentUser).static void Delete(CustomerDetails[] customers)
Deletes each customer in the array.static CustomerDetails[] GetAllCustomers()
Fetches all ISO customers viaDTS.Common.ISO.CustomerDetails.GetAllCustomerDetails(), wraps each inCustomerDetails, sorts byName(ordinal), and returns as array.static void DeleteAll()
CallsDTS.Common.ISO.CustomerDetails.DeleteCustomerDetails().static CustomerDetails GetCustomerDetail(string name)
Returns a wrappedCustomerDetailsfor the givenname, ornullif not found ornameis null/empty.
LabratoryDetails (inherits BasePropertyChanged)
bool IsBlank()
Returns_isBlank, initializedtrue, set tofalseon first property mutation.string Name { get; set; }
Display name; triggers_isBlank = falseandOnPropertyChanged("Name").string LabratoryName { get; set; }
Laboratory name.string LabratoryContactName { get; set; }
Contact person name.string LabratoryContactPhone { get; set; }
Contact phone number.string LabratoryContactFax { get; set; }
Contact fax number.string LabratoryContactEmail { get; set; }
Contact email address.string LabratoryTestRefNumber { get; set; }
Laboratory test reference number.string LabratoryProjectRefNumber { get; set; }
Laboratory project reference number.bool LocalOnly { get; }
GetsLocalOnlyfrom underlying ISO object.DateTime LastModified { get; }
Gets last modification timestamp.string LastModifiedBy { get; }
Gets last modifier username.int Version { get; }
Gets record version.bool HasBlankName()
ReturnstrueifName == StringResources.TestTemplate_EmptyListName.LabratoryDetails()
Default constructor: initializes_labwith newDTS.Common.ISO.LabratoryDetails, setsNametoTestTemplate_EmptyListName,_isBlank = true.LabratoryDetails(DTS.Common.ISO.LabratoryDetails lab)
Wraps an existing ISO object; sets_isBlank = false.DTS.Common.ISO.LabratoryDetails GetIsoLab()
Returns the underlying ISO object.override string ToString()
ReturnsName.
LabratoryDetailsList
static LabratoryDetails[] GetAllLabs()
Fetches all ISO labs viaDTS.Common.ISO.LabratoryDetails.GetAllLabratoryDetails(), wraps each, sorts byName, returns array.static void DeleteAll()
CallsDTS.Common.ISO.LabratoryDetails.DeleteLabratoryDetails().static void Delete(LabratoryDetails lab)
Callslab?.GetIsoLab().Delete(currentUser).static void Delete(LabratoryDetails[] labs)
Deletes each lab in the array.static LabratoryDetails GetLab(string name)
Returns a wrappedLabratoryDetailsfor the givenname, ornullif not found ornameis null/empty.
TestEngineerDetails (inherits BasePropertyChanged)
bool IsBlank()
Returns_blank, initializedtrue, set tofalseon first mutation.string Name { get; set; }
Display name; triggers_blank = falseandOnPropertyChanged("Name").string TestEngineerName { get; set; }
Full test engineer name.string TestEngineerPhone { get; set; }
Phone number.string TestEngineerFax { get; set; }
Fax number.string TestEngineerEmail { get; set; }
Email address.bool LocalOnly { get; }
GetsLocalOnlyfrom underlying ISO object.DateTime LastModified { get; }
Gets last modification timestamp.string LastModifiedBy { get; }
Gets last modifier username.int Version { get; }
Gets record version.bool HasBlankName()
ReturnstrueifName == StringResources.TestTemplate_EmptyListName.TestEngineerDetails()
Default constructor: initializes_testEngineerDetailswith newDTS.Common.ISO.TestEngineerDetails, setsNametoTestTemplate_EmptyListName,_blank = true.TestEngineerDetails(DTS.Common.ISO.TestEngineerDetails testEngineerDetails)
Wraps an existing ISO object; sets_blank = false.DTS.Common.ISO.TestEngineerDetails GetISOTestEngineer()
Returns the underlying ISO object.override string ToString()
ReturnsName.
TestEngineerDetailsList (inherits BasePropertyChanged)
static TestEngineerDetailsList TestEngineerList { get; }
Singleton instance ofTestEngineerDetailsList.void Delete(TestEngineerDetails testEngineer)
Deletes from ISO store, removes from internal_testEngineersdictionary, and raisesOnPropertyChanged("TestEngineers").void Delete(TestEngineerDetails[] testEngineers)
Deletes each engineer in the array.TestEngineerDetails[] TestEngineers { get; }
Returns all engineers sorted byName. Lazily populates fromGetAllTestEngineers()if_testEngineersis null/empty (thread-safe via lock).void ReloadAll()
Clears_testEngineersand repopulates fromGetAllTestEngineers().void DeleteAll()
Clears_testEngineers, callsDTS.Common.ISO.TestEngineerDetails.DeleteAllTestEngineerDetails().TestEngineerDetails GetTestEngineerDetail(string name)
Returns engineer byNamefrom in-memory cache (TestEngineers), ornullif not found ornameis null/whitespace.void AddTestEngineer(TestEngineerDetails testEngineer)
Commits to ISO store, adds/updates in_testEngineersdictionary, and raisesOnPropertyChanged("TestEngineers").static TestEngineerDetails[] GetAllTestEngineers()
Returns all engineers. Special behavior: ifRunTestVariables.InRunTestistrueandTestTemplateList.TestTemplatesList.CachedTestEngineerDetailsis populated, returns cached data (converted to ISO objects and wrapped); otherwise fetches fromDTS.Common.ISO.TestEngineerDetails.GetAllTestEngineerDetails().
3. Invariants
_blank/_isBlankstate:- For
CustomerDetailsandTestEngineerDetails,_blankstartstrueand is set tofalseon first property setter invocation. - For
LabratoryDetails,_isBlankbehaves identically. IsBlank()returns this state, but it is not reset by any operation (e.g.,DeleteAll()does not reset it).
- For
Namefield semantics:- Default constructor sets
NametoStringResources.TestTemplate_EmptyListName. HasBlankName()checks for this exact string.Nameis used as the primary key for lookup (GetCustomerDetail,GetLab,GetTestEngineerDetail,CompareCustomers, etc.).
- Default constructor sets
- Sorting:
GetAllCustomers(),GetAllLabs(), andTestEngineersgetter sort byNameusingstring.Compare(..., StringComparison.Ordinal).
- Persistence layer:
- All mutations (
seton properties,Add*,Delete*) ultimately call methods onDTS.Common.ISO.*types (e.g.,Commit,Delete). CommitandDeleteare called withApplicationProperties.CurrentUser.UserName.
- All mutations (
- Caching for run-test mode:
TestEngineerDetailsList.GetAllTestEngineers()uses cached data only whenRunTestVariables.InRunTestistrueandCachedTestEngineerDetailsis non-null/non-empty.- This cache is not used by
CustomerDetailsListorLabratoryDetailsList.
4. Dependencies
Internal Dependencies (from source)
DTS.Common.ISO.*
Core data models:CustomerDetails,LabratoryDetails,TestEngineerDetails(ISO layer).DTS.Common.Base.BasePropertyChanged
Base class forINotifyPropertyChangedimplementation.DTS.Common.SharedResource.Strings.StringResources
Used forTestTemplate_EmptyListName.DTS.Common.Storage.ApplicationProperties
Used to getCurrentUser.UserName.DTS.Common.Enums.RunTestVariables
Used inTestEngineerDetailsList.GetAllTestEngineers()to checkInRunTest.DTS.Common.DataModel.TestTemplateList.TestTemplatesList
Used inTestEngineerDetailsList.GetAllTestEngineers()to accessCachedTestEngineerDetails.
External Dependencies (inferred)
- WPF (
System.Windows)
Used forApplicationProperties.CurrentUser(likely tied to WPF app context). - .NET Core/Standard runtime
Standard libraries (System,System.Collections.Generic,System.Linq).
What depends on this module?
- UI layers (WPF) binding to
CustomerDetails,LabratoryDetails,TestEngineerDetailsproperties. - Any code managing test metadata (e.g., test setup, reporting) via
*DetailsListstatic methods. TestTemplateList.TestTemplatesList(indirectly via caching dependency).
5. Gotchas
- Inconsistent naming:
- Class is named
LabratoryDetails(misspelled "Laboratory") in all files. This is preserved in ISO layer and must be used as-is.
- Class is named
IsBlank()behavior is one-way:- Once set to
false,_blank/_isBlankis never reset (e.g., byDelete,Clear, orReloadAll). A deleted record may still reportIsBlank() == false.
- Once set to
TestEngineerDetailsListis a singleton with mutable state:_testEngineerListis static;TestEngineerListreturns the same instance.TestEngineersproperty caches data in_testEngineersdictionary, which is lazily populated and cleared only byDeleteAll()orReloadAll().- Concurrent access is partially protected by
lock (_testEngineerLock)inTestEngineersgetter andAddTestEngineer, butGetTestEngineerDetailusesAsParallel()onTestEngineerswithout locking—potential race condition ifTestEngineersis being repopulated.
GetAllTestEngineers()has conditional caching logic:- Behavior changes based on
RunTestVariables.InRunTestandCachedTestEngineerDetails. This is not obvious from the class alone and may cause inconsistent data if caching is stale or misconfigured.
- Behavior changes based on
CustomerDetailsListandLabratoryDetailsListlack instance methods:- All operations are
static. OnlyTestEngineerDetailsListprovides instance methods (e.g.,AddTestEngineer,Delete(TestEngineerDetails)), suggesting inconsistent design or incomplete refactoring.
- All operations are
- No validation on property setters:
- Setting
Nametonullor empty is allowed (thoughHasBlankName()checks only forTestTemplate_EmptyListName). GetCustomerDetail,GetLab,GetTestEngineerDetailreturnnullfornull/empty/whitespace input, but no validation prevents setting such values onName.
- Setting
ToString()returnsName:- If
Nameisnull, this may causeNullReferenceExceptionin UI bindings orstring.Formatcalls.
- If
None identified beyond the above for CustomerDetails and LabratoryDetails.