# kubra-kzlk/lampify-testing architecture

> Architecture diagram of the GitHub repository kubra-kzlk/lampify-testing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kubra-kzlk/lampify-testing
- Repository: https://github.com/kubra-kzlk/lampify-testing

## Overview

##### Main Components Identification

a) Core Components:
- LampController (Central Control)
- Lamp Implementation
- LightSensorApi
- Test Suites (Unit, Integration, Acceptance)

b) Interfaces:
- ILamp
- ILightSensorApi

**┌─────────────────────────────────────────────────────┐**
- Testing Layer                      │
- ┬─────────────────┬──────────────────┤
- Unit Tests    │ Integration     │ Acceptance Tests  │
- (xUnit)       │ Tests          │ (BDD/Gherkin)     │
- ┬───────┴────────┬────────┴─────────┬────────┘

**┌───────▼────────────────▼───────────────────▼───────┐**
- Application Layer                     │
- ┤
- LampController                      │
- ┬────────────────────────────┤
- ILamp          │      ILightSensorApi       │
- ┬───────────┴──────────────┬────────────┘

**┌────────────▼──────────┐   ┌──────────▼────────────┐**
- Lamp Implementation │   │   LightSensorApi      │
- ┘   └─────────────────────┘

##### Special Features to Highlight

Create dedicated sections showing:
- Mood Management System
- Safe Mode Trigger Flow
- Error Handling Paths

##### Detailed Elements

Specific details:
**┌─────────────────────┐**
- Mood States     │
- ┤
- • Cozy (50%, Red)   │
- • Angry (100%, Red) │
- • Bright (100%, White)│
- • Dark (Off)        │
- ┘

##### Testing Flow Visualization

Relationship between:
- TDD cycle (Red-Green-Refactor)
- Integration test paths
- BDD scenario execution

##### Error Handling Paths
**┌─────────────────┐**
- Error Handling │
- ┤
- 3x Failures     │
- ↓         │
- Safe Mode     │
- ┘

Key Considerations:

##### Critical paths and failure points

- Layered architecture representation
- Clear component relationships
- Custom styling for different component types
- Easy updating for future modifications

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef core fill:#a8d1f0,stroke:#333
    classDef interface fill:#fff4b3,stroke:#333
    classDef test fill:#b3ffb3,stroke:#333
    classDef error fill:#ffb3b3,stroke:#333
    classDef mood fill:#e6ccff,stroke:#333

    %% Testing Layer
    subgraph Testing
        UT["Unit Tests (xUnit)"]:::test
        IT["Integration Tests"]:::test
        AT["Acceptance Tests (BDD/Gherkin)"]:::test
        EHT["Error Handling Tests"]:::test
    end

    %% Application Layer
    subgraph Application
        LC["LampController"]:::core
        ILamp["ILamp Interface"]:::interface
        ILSA["ILightSensorApi Interface"]:::interface
        LI["Lamp Implementation"]:::core
        LSA["LightSensorApi"]:::core
    end

    %% Mood Management
    subgraph MoodStates
        MS["Mood States"]:::mood
        Cozy["Cozy (50%, Red)"]:::mood
        Angry["Angry (100%, Red)"]:::mood
        Bright["Bright (100%, White)"]:::mood
        Dark["Dark (Off)"]:::mood
    end

    %% Error Handling
    subgraph ErrorHandling
        EH["Error Handling"]:::error
        SF["Safe Mode (After 3x Failures)"]:::error
    end

    %% Relationships
    LC --> ILamp
    LC --> ILSA
    LI -.-> ILamp
    LSA -.-> ILSA
    UT --> LC
    IT --> LC
    AT --> LC
    EHT --> EH
    EH --> SF
    LC --> MS
    MS --> Cozy
    MS --> Angry
    MS --> Bright
    MS --> Dark

    %% Click events
    click LC "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_testing/LampController.cs"
    click LI "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_testing/Lamp.cs"
    click LSA "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_testing/LightSensorApi.cs"
    click ILamp "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_testing/ILamp.cs"
    click ILSA "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_testing/ILightSensorApi.cs"
    click UT "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_UnitTests/LampTests.cs"
    click IT "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_IntegrationTests/LampTests.cs"
    click AT "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_AcceptanceTests/Features/Lamp.feature"
    click EHT "https://github.com/kubra-kzlk/Lampify-testing/blob/main/Lampify_AcceptanceTests/Features/LampFailure.feature"
```
