Files
DP44/enriched-qwen3-coder-next/Common/DTS.CommonCore/Enums/TestSetups.md
2026-04-17 14:55:32 -04:00

3.5 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.CommonCore/Enums/TestSetups/RealtimeGraphsEnum.cs
2026-04-16T02:44:28.591642+00:00 Qwen/Qwen3-Coder-Next-FP8 1 5da219cbdf4b218e

TestSetups

1. Purpose

This module defines a strongly-typed enumeration RealtimeGraphsEnum used to represent configurable numbers of real-time graphs in the system—specifically, one, three, or six graphs. It is part of the DTS.Common.Enums.TestSetups namespace and is intended for use in test setup configurations where the UI or backend logic must select or validate the number of concurrent real-time data visualizations. The enum is annotated with [Description] attributes and leverages a custom EnumDescriptionTypeConverter to support localization or display-name resolution (e.g., for UI binding or serialization).

2. Public Interface

  • RealtimeGraphsEnum
    • One = 1 — Represents a configuration with one real-time graph.
    • Three = 3 — Represents a configuration with three real-time graphs.
    • Six = 6 — Represents a configuration with six real-time graphs.
      All members are explicitly assigned integer values (1, 3, 6), and each has a [Description] attribute containing a string key (e.g., "RealtimeGraphs_One") rather than a human-readable label—suggesting the actual display text is resolved externally (e.g., via resource files using the description string as a key).

3. Invariants

  • Only the values 1, 3, and 6 are valid for this enum; no other numeric values are defined.
  • The enum is not marked as [Flags], so bitwise combinations are not intended or supported.
  • The [Description] attribute values are keys, not display strings—consumers must resolve them via the EnumDescriptionTypeConverter or external localization mechanism.
  • The enum relies on DTS.Common.Converters.EnumDescriptionTypeConverter; invalid usage without this converter may result in raw numeric values or unlocalized strings.

4. Dependencies

  • Depends on:
    • System.ComponentModel (for DescriptionAttribute and TypeConverter)
    • DTS.Common.Converters.EnumDescriptionTypeConverter (custom type converter for resolving descriptions)
  • Used by:
    • Likely consumed by UI layers (e.g., dropdowns, configuration editors) and test setup logic in DTS.CommonCore or downstream modules (e.g., DTS.TestRunner, DTS.UI).
    • Not directly inferable from this file, but any code that serializes/deserializes or binds to RealtimeGraphsEnum will depend on this type.

5. Gotchas

  • Non-sequential values: The enum uses 1, 3, 6—not contiguous integers. Code assuming sequential or incremental values (e.g., for (int i = 1; i <= 6; i++)) may fail or misbehave.
  • Description strings are keys, not labels: The [Description] values (e.g., "RealtimeGraphs_One") are not user-facing text; they are resource keys. Relying on ToString() or direct DescriptionAttribute access without the converter will yield these keys—not localized text.
  • TypeConverter dependency: If EnumDescriptionTypeConverter is missing or misconfigured (e.g., in serialization contexts like JSON.NET without custom converters), deserialization or display may fall back to numeric values or fail.
  • No Default or None member: There is no 0 or Unspecified value; uninitialized or invalid enum values will default to 0, which is not a defined member—this may cause InvalidCastException or unexpected behavior if cast from an arbitrary int.