Skip to content

Commit b0241da

Browse files
committed
Update documentation to reflect changes in GitHub Copilot's Chat view agents and enhance clarity on unit testing features
1 parent fb7b555 commit b0241da

8 files changed

Lines changed: 74 additions & 78 deletions

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/7-knowledge-check.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@ quiz:
5050
- content: "To check if the function returns the expected output."
5151
isCorrect: false
5252
explanation: "Incorrect. Generating assertions for function input parameters is not primarily done to check the function's output."
53-
- content: "What does the GitHub Copilot extension for Visual Studio Code provide when creating unit tests for specific conditions?"
53+
- content: "What are the three built-in agents available in the Chat view for creating unit tests?"
5454
choices:
55-
- content: "It provides a user interface for manually writing tests."
55+
- content: "Ask, Edit, and Agent."
5656
isCorrect: false
57-
explanation: "Incorrect. GitHub Copilot does not provide a user interface for writing tests. GitHub Copilot suggests completions and generates tests."
58-
- content: "It automatically runs the tests and provides the results."
59-
isCorrect: false
60-
explanation: "Incorrect. GitHub Copilot does not run tests. GitHub Copilot helps generate them."
61-
- content: "It suggests completions and generates tests based on the code context."
57+
explanation: "Incorrect. Edit mode has been replaced. The three built-in agents available in the Chat view are Ask, Plan, and Agent."
58+
- content: "Ask, Plan, and Agent."
6259
isCorrect: true
63-
explanation: "Correct. GitHub Copilot suggests completions and generates tests based on the code context."
64-
- content: "What is the benefit of using GitHub Copilot for generating unit tests?"
60+
explanation: "Correct. The Chat view provides three built-in agents: Ask for answering questions, Plan for creating structured implementation plans before writing code, and Agent for agentic coding workflows."
61+
- content: "Plan, Debug, and Agent."
62+
isCorrect: false
63+
explanation: "Incorrect. Debug is not a built-in agent in the Chat view. The three built-in agents are Ask, Plan, and Agent."
64+
- content: "What is the purpose of the Plan agent in the Chat view?"
6565
choices:
66-
- content: "It reduces the need for manual testing."
66+
- content: "It automatically implements code changes across multiple files in the workspace."
6767
isCorrect: false
68-
explanation: "Incorrect. While GitHub Copilot helps generate unit tests, it does not eliminate the need for manual testing."
69-
- content: "It can suggest a range of unit tests based on the code context, saving development time."
68+
explanation: "Incorrect. The Plan agent does not make code changes. The Plan agent creates a structured implementation plan, which can then be handed off to the Agent for implementation."
69+
- content: "It creates a structured, step-by-step implementation plan before writing any code."
7070
isCorrect: true
71-
explanation: "Correct. GitHub Copilot can suggest a range of unit tests based on the code context, which can save development time."
72-
- content: "It automatically fixes bugs in the code."
71+
explanation: "Correct. The Plan agent researches the task comprehensively, asks clarifying questions, and produces a step-by-step plan. Once the plan is reviewed and approved, it can be handed off to the Agent for implementation."
72+
- content: "It runs tests and generates test reports for the project."
7373
isCorrect: false
74-
explanation: "Incorrect. GitHub Copilot does not fix bugs. GitHub Copilot helps generate unit tests."
74+
explanation: "Incorrect. The Plan agent does not run tests or generate reports. The Plan agent creates a detailed implementation plan that can be handed off to the Agent for implementation."

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/includes/1-introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ The topics covered in this module include:
99
- Using GitHub Copilot and Visual Studio Code for unit testing.
1010
- Generate unit tests with GitHub Copilot's Generate Tests smart action.
1111
- Creating unit tests with GitHub Copilot Inline Chat.
12-
- Creating unit tests with GitHub Copilot Chat Modes.
12+
- Creating unit tests with GitHub Copilot Chat view agents.
1313
- Developing unit tests with GitHub Copilot in C#.
1414

1515
After completing this module, you’ll be able to:
1616

1717
- Explain how GitHub Copilot Chat supports various testing tasks, including unit, integration, and end-to-end tests.
1818
- Use the Generate Tests smart action to create unit tests for specific code blocks or entire files.
1919
- Leverage the Inline Chat feature to generate and refine unit tests directly within the code editor.
20-
- Utilize the Chat view modes—Ask, Edit, and Agent—to create, update, and automate unit test workflows.
20+
- Utilize the Chat view agents—Ask, Plan, and Agent—to create, plan, and automate unit test workflows.
2121
- Apply GitHub Copilot's capabilities to streamline the development of unit tests for a C# application in Visual Studio Code.
2222

2323
> [!IMPORTANT]

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/includes/2-examine-github-copilot-support-unit-tests.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ GitHub Copilot Chat uses your code's context and semantics to suggest assertions
77
88
## GitHub Copilot support for unit testing
99

10-
Copilot can help with the following testing tasks:
10+
GitHub Copilot can help with the following testing tasks:
1111

1212
- Set up testing frameworks: get help configuring the right testing framework and VS Code extensions for your project and language.
1313
- Generate test code: create unit tests, integration tests, and end-to-end tests that cover your application code.
1414
- Handle edge cases: generate comprehensive test suites to cover edge cases and error conditions.
1515
- Fix failing tests: receive suggestions for fixing test failures.
16-
- Maintain consistency: personalize Copilot to generate tests that follow your project's coding practices.
16+
- Maintain consistency: personalize GitHub Copilot to generate tests that follow your project's coding practices.
1717

1818
### Set up your testing framework
1919

20-
To accelerate your testing workflow, Copilot can help set up the testing framework and VS Code extensions for your project. Copilot suggests appropriate testing frameworks based on your project type.
20+
To accelerate your testing workflow, GitHub Copilot can help set up the testing framework and VS Code extensions for your project. GitHub Copilot suggests appropriate testing frameworks based on your project type.
2121

2222
1. Open the Chat view.
2323

@@ -31,35 +31,35 @@ GitHub Copilot can help you write tests for your application code by generating
3131

3232
You can generate unit tests using the following GitHub Copilot tools:
3333

34-
- **Chat view**: Use the Chat view generate unit tests for a project, class, or method using Ask, Edit, or Agent mode.
34+
- **Chat view**: Use the Chat view to generate unit tests for a project, class, or method using the Ask, Plan, or Agent.
3535
- **Inline Chat**: Use Inline Chat to generate unit tests for selected classes or methods.
3636
- **Smart actions**: Use the Generate Tests smart action to generate unit tests for selected code without writing a prompt.
3737
- **Code line completions**: Use code line completions to suggest addition unit tests for an existing test case.
3838

3939
### Fix failing tests
4040

41-
Copilot integrates with the Test Explorer in Visual Studio Code and can help with fixing failing tests.
41+
GitHub Copilot integrates with the Test Explorer in Visual Studio Code and can help with fixing failing tests.
4242

4343
1. In the Test Explorer, hover over a failing test.
4444

4545
1. Select the **Fix Test Failure** button (sparkle icon)
4646

47-
1. Review and apply Copilot's suggested fix.
47+
1. Review and apply GitHub Copilot's suggested fix.
4848

4949
Alternatively, you can:
5050

5151
1. Open the Chat view.
5252

5353
1. Enter the `/fixTestFailure` slash command.
5454

55-
1. Follow Copilot's suggestions to fix the test
55+
1. Follow GitHub Copilot's suggestions to fix the test
5656

5757
> [!TIP]
58-
> Agent mode monitors the test output when running tests, and automatically attempts to fix and rerun failing tests.
58+
> When using agents, the agent monitors the test output when running tests, and automatically attempts to fix and rerun failing tests.
5959
6060
### Maintain consistency
6161

62-
If your organization has specific testing requirements, you can customize how Copilot generates tests to ensure they meet your standards. You can personalize how Copilot generates tests by providing custom instructions. For example:
62+
If your organization has specific testing requirements, you can customize how GitHub Copilot generates tests to ensure they meet your standards. You can personalize how GitHub Copilot generates tests by providing custom instructions. For example:
6363

6464
- Specify preferred testing frameworks
6565
- Define naming conventions for tests
@@ -171,19 +171,19 @@ This process creates a new project and configures the test runner for the select
171171

172172
### Generate unit test cases using GitHub Copilot Chat
173173

174-
GitHub Copilot Chat can be used to help you write unit test cases for your test framework. Copilot Chat recognizes your test framework and coding style and generates matching code snippets. You can use Copilot Chat to complete the following tasks:
174+
GitHub Copilot Chat can be used to help you write unit test cases for your test framework. GitHub Copilot Chat recognizes your test framework and coding style and generates matching code snippets. You can use GitHub Copilot Chat to complete the following tasks:
175175

176-
- Write unit test cases for your test framework based on the code open in the editor or the code snippet you highlight in the editor. Copilot identifies your test framework and coding style and generates matching code snippets.
176+
- Write unit test cases for your test framework based on the code open in the editor or the code snippet you highlight in the editor. GitHub Copilot identifies your test framework and coding style and generates matching code snippets.
177177

178-
- Identify and write test cases for edge cases and boundary conditions that might be difficult to identify manually. For instance, Copilot can suggest test cases for error handling, null values, or unexpected input types.
178+
- Identify and write test cases for edge cases and boundary conditions that might be difficult to identify manually. For instance, GitHub Copilot can suggest test cases for error handling, null values, or unexpected input types.
179179

180180
- Suggest assertions that ensure the function is working correctly, based on the code's context and semantics. For example, generate assertions to ensure that function input parameters are valid.
181181

182-
Consider the following scenarios when asking Copilot Chat to generate unit test cases:
182+
Consider the following scenarios when asking GitHub Copilot Chat to generate unit test cases:
183183

184-
- If a single method is visible in full in the editor, you could ask Copilot Chat to generate a unit test for the method by typing `Write a unit test for the method in the #editor`.
184+
- If a single method is visible in full in the editor, you could ask GitHub Copilot Chat to generate a unit test for the method by typing `Write a unit test for the method in the #editor`.
185185

186-
- If there are multiple methods visible or the intended method extends beyond what's visible in the editor, select the code you want to generate a unit test for, then ask Copilot: `#selection write a unit test for this code`.
186+
- If there are multiple methods visible or the intended method extends beyond what's visible in the editor, select the code you want to generate a unit test for, then ask GitHub Copilot: `#selection write a unit test for the selected code`.
187187

188188
### Run and manage unit tests in Visual Studio Code
189189

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/includes/3-create-unit-tests-generate-tests-smart-action.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To generate unit tests for a file, follow these steps:
1010

1111
1. Open the file that contains the code you want to test.
1212

13-
1. Right-click inside the code editor, select **Copilot**, and then select **Generate Tests**.
13+
1. Right-click inside the code editor, select **Generate Code**, and then select **Generate Tests**.
1414

1515
1. GitHub Copilot analyzes the code and generates unit tests for all functions and methods in the file.
1616

@@ -44,7 +44,7 @@ To generate unit tests for a selection of code, follow these steps:
4444

4545
1. Select the code block that you want to test.
4646

47-
1. Right-click the selected code, select **Copilot**, and then select **Generate Tests**.
47+
1. Right-click the selected code, select **Generate Code**, and then select **Generate Tests**.
4848

4949
1. GitHub Copilot analyzes the selected code and generates unit tests for the selected function or method.
5050

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/includes/4-create-unit-tests-inline-chat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To create unit tests using Inline Chat, follow these steps:
2020

2121
You can make adjustments, such as changing the test names, modifying or removing test cases, or adding additional assertions.
2222

23-
The generated tests are displayed in the code editor. Copilot generates test code in an existing test file, or creates a new test file if one doesn't exist.
23+
The generated tests are displayed in the code editor. GitHub Copilot generates test code in an existing test file, or creates a new test file if one doesn't exist.
2424

2525
1. Select **Accept** or **Close** to accept or discard the suggested unit tests.
2626

0 commit comments

Comments
 (0)