mirror of
https://github.com/azaion/admin.git
synced 2026-04-22 11:46:33 +00:00
[AZ-189] [AZ-190] [AZ-191] [AZ-192] [AZ-193] [AZ-194] [AZ-195] Add e2e blackbox test suite
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# Module: Azaion.Common.Extensions.EnumExtensions
|
||||
|
||||
## Purpose
|
||||
Static utility class for extracting `DescriptionAttribute` values from enum members and retrieving default enum values.
|
||||
|
||||
## Public Interface
|
||||
|
||||
| Method | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `GetDescriptions<T>` | `static Dictionary<T, string> GetDescriptions<T>() where T : Enum` | Returns all enum values mapped to their `[Description]` text |
|
||||
| `GetDescription` | `static string GetDescription(this Enum enumValue)` | Extension: gets the `[Description]` of a single enum value |
|
||||
| `GetDefaultValue<TEnum>` | `static TEnum GetDefaultValue<TEnum>() where TEnum : struct` | Returns the `[DefaultValue]` attribute's value for an enum type |
|
||||
|
||||
## Internal Logic
|
||||
- `GetDescriptions<T>` iterates all enum values via `Enum.GetValues`, using a private helper `GetEnumAttrib` to extract the `DescriptionAttribute` via reflection. Falls back to `.ToString()` when no attribute exists.
|
||||
- `GetEnumAttrib<T, TAttrib>` fetches a custom attribute from an enum member's `FieldInfo`.
|
||||
|
||||
## Dependencies
|
||||
- `System.ComponentModel.DescriptionAttribute`, `System.Reflection` (BCL only)
|
||||
|
||||
## Consumers
|
||||
- `BusinessException` (static constructor calls `GetDescriptions<ExceptionEnum>()`)
|
||||
|
||||
## Data Models
|
||||
None.
|
||||
|
||||
## Configuration
|
||||
None.
|
||||
|
||||
## External Integrations
|
||||
None.
|
||||
|
||||
## Security
|
||||
None.
|
||||
|
||||
## Tests
|
||||
None.
|
||||
Reference in New Issue
Block a user