diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd80b03 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# StrategySort-MVC-WinForms + +A lightweight C# WinForms application that demonstrates string sorting using various algorithms. This project implements the **Strategy Pattern** for algorithm selection and the **MVC (Model-View-Controller) Pattern** to ensure a clean separation of concerns. + +## ๐Ÿš€ Features + +* **Custom String Sorting:** Input any text and sort its characters alphabetically. +* **Multiple Algorithms:** Choose between Bubble Sort, Merge Sort, and Quick Sort. +* **Architectural Excellence:** Built using MVC and Strategy design patterns. +* **Robustness:** Includes a dedicated Unit Test project to ensure sorting accuracy. + +## ๐Ÿ›  Architecture + +This project is designed with scalability and maintainability in mind: + +### 1. Strategy Pattern +The sorting logic is decoupled from the main application. Each algorithm implements a common `ISortStrategy` interface, allowing the program to swap sorting behaviors at runtime without changing the client code. + + + +### 2. MVC Pattern +* **Model:** Handles the data logic and the execution of the sorting strategies. +* **View:** The WinForms interface (`TextSortWindow`) which captures user input and displays results. +* **Controller:** Acts as the bridge between the View and the Model, processing user commands and updating the UI. + +--- + +## ๐Ÿ“ธ How It Works + +1. **Input:** Enter any string into the text box (e.g., `github`). +2. **Select Strategy:** Choose a sorting algorithm from the ComboBox: + * `Bubble Sort` + * `Merge Sort` + * `Quick Sort` +3. **Sort:** Click the **Sort** button. +4. **Output:** The sorted result (e.g., `bgghitu`) appears in the output label. + +--- + +## ๐Ÿงช Unit Testing + +The solution includes a `Testing` project using **MSTest** to validate the sorting logic. + +* Tests verify character sorting for empty strings, special characters, and long strings. +* Ensures all three strategies return consistent results. \ No newline at end of file