A professional Windows Forms stopwatch application built with C# following Test-Driven Development principles.
- Start: Begins timing from 00:00:00
- Pause: Temporarily stops the timer while preserving elapsed time
- Resume: Continues timing from the paused point
- Reset: Returns the timer to 00:00:00
- Stop: Completely stops the timer and displays final time
- Time Format: 00:00:00 (hours:minutes:seconds)
- Update Frequency: 100ms for smooth display
- Framework: .NET 7.0 Windows Forms
- Testing: comprehensive unit tests
copy the github link : then dotnet run
- .NET 7.0 SDK or later
- Windows operating system
- Open Command Prompt or PowerShell
- Navigate to the project directory:
cd c:\Users\user\stopwatch_GC1\Stopwatch - Build and run the application:
dotnet run
To execute the unit tests:
dotnet test
- StopwatchEngine: Core timing logic with precise time tracking
- MainForm: Windows Forms UI with intuitive button controls
- Program: Application entry point
- Precise Timing: Uses System.Diagnostics.Stopwatch for accuracy
- State Management: Proper handling of running, paused, and stopped states
- UI Updates: Real-time display updates every 100ms
- Button States: Smart enabling/disabling based on current state
The application features a stunning modern interface with:
- 🎨 Dark gradient theme with animated glow effects
- ⏱️ Large digital display (36pt Segoe UI) with rounded panel
- 🌟 Animated border glow that pulses when running
- 🎯 Modern rounded buttons with gradient styling and emojis
- ✨ Smooth animations and visual feedback
- 🖼️ Borderless design with custom close button
- 🎭 Dynamic status indicators with contextual colors and icons
- XML Documentation: Complete documentation for all public methods
- Test Coverage: Comprehensive unit tests covering all functionality
- Clean Architecture: Separation of concerns between UI and business logic
- Error Handling: Robust state management preventing invalid operations
- Modern UI: Custom controls with gradient rendering and smooth animations
- Visual Polish: Professional design with attention to detail
| Button | Function | Enabled When |
|---|---|---|
| Start | Begins timing from 00:00:00 | Stopwatch is stopped |
| Pause | Temporarily stops timer | Stopwatch is running |
| Resume | Continues from paused time | Stopwatch is paused |
| Reset | Returns to 00:00:00 | Always available |
| Stop | Completely stops timer | Stopwatch is running or paused |
The project follows Test-Driven Development (TDD) with tests covering:
- Initial state verification
- Start/stop functionality
- Pause/resume operations
- Reset functionality
- Time format validation
- State transitions
Stopwatch/
├── Program.cs # Application entry point
├── MainForm.cs # Windows Forms UI
├── StopwatchEngine.cs # Core timing logic
├── StopwatchEngineTests.cs # Unit tests
├── Stopwatch.csproj # Project configuration
└── README.md # This documentation
- Built with clean, maintainable code following C# best practices
- Comprehensive XML documentation for all public methods
- Responsive UI that updates smoothly during operation
- Proper resource management and disposal
- Thread-safe operations for UI updates
## Demo video
(https://drive.google.com/file/d/19ZHsJV0qt17Ws0kFnqZNGv_6FZDaeciC/view?usp=sharing)