test
Wordle Workshop - API Endpoints Implementation
Task 0: Setup
- Navigate to the Wordle Project.
- Go to
Plan -> Issues -> New Item - In the
Descriptiondrop down select `Workshop Instructions`` - Assign the issue to yourself
- Press
Create Issue - In the Issue press
Create merge request
Task 1: Get an overview of the application
Objective
Get an overview of the application. Use Duo Chat to understand the structure of the application.
Instructions
- Open Duo Chat
- use the
/includeand chooseFiles. Search for.csand select multiple files by pressingEnter. - Ask Duo Chat to create a Mermaid class diagram of the application.
- Paste the markdown code into this mermaid live editor.
Task 2: Implement GetGameState Endpoint
Objective
Create a method in the WordleController.cs class that provides a GetGameState endpoint to retrieve the complete state of a specific game.
Requirements
-
Endpoint:
GET /api/wordle/{gameId}/state - Response: Return complete game state information
- Error Handling: Handle cases where game doesn't exist
- Response Type: Use appropriate HTTP status codes
-
Expected Response Structure:
{ "gameId": "abc12345", "targetWord": { "value": "*****" }, "maxAttempts": 6, "guesses": [], "isGameOver": false, "isWon": false, "remainingAttempts": 6, "startTime": "2025-11-04T17:37:59.520Z" }
Instructions
- Go to the
WordleController.csclass - Add the following comment:
// Create a stats endpoint that gives information about the state of a specific game and the last guess - Press enter and notice the GitLab Tanuki item - Wait for a suggestion
Task 3: Fix the GetGame endpoint
Objective
Add error handling for when the given key does not exist.
Requirements
-
Endpoint:
GET /api/wordle/new - Response: Return error message when given key is not found
Instructions
- Go to the
WordleController.csclass - Highlight the GetGame function.
- Right click -> GitLab Duo Chat -> Fix
- Look at the result and press
Insert at cursor
Task 4: Add unit tests for the IsValidLength method
Objective
Add unit tests for the IsValidLength method in the Word.cs class.
Instructions
- Go to the
Word.csclass - Highlight the
IsValidLengthfunction. - Go to the Duo Chat and type
/tests use xunit only - Verify the results
- Navigate to the
WordTests.csfile and paste the tests into the file
Task 4: Add unit tests for the IsValidLength method
Objective
Add unit tests for the IsValidLength method in the Word.cs class.
Instructions
- Go to the
Word.csclass - Highlight the
IsValidLengthfunction. - Go to the Duo Chat and type
/tests use xunit only - Verify the results
- Navigate to the
WordTests.csfile and paste the tests into the file