Skip to content

Commit c7f093c

Browse files
authored
changed files by pdets auto publish service, publishid[21621ce8-0b01-4567-9dbd-b2e995f79d1e] and do [publish].
1 parent a6364a2 commit c7f093c

File tree

4 files changed

+46
-43
lines changed

4 files changed

+46
-43
lines changed
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
11
The Chat view in Visual Studio Code provides three modes that can be used to create unit tests: Ask, Edit, and Agent. Each mode has its own strengths and weaknesses, and the best mode to use depends on the specific task at hand.
22

3-
- The Ask mode is optimized for asking questions about your code projects, coding topics, and general technology concepts.
4-
- The Edit mode is optimized for making edits across multiple files in your codebase.
5-
- The Agent mode is optimized for starting an agentic coding workflow.
3+
- The ask mode is optimized for asking questions about your code projects, coding topics, and general technology concepts.
4+
- The edit mode is optimized for making edits across multiple files in your codebase.
5+
- The agent mode is optimized for starting an agentic coding workflow.
66

77
> [!IMPORTANT]
8-
> When you use the Chat view in Agent mode, GitHub Copilot may make multiple premium requests to complete a single task. This includes both user-initiated prompts and follow-up actions Copilot takes on your behalf. The total premium requests used will depend on the complexity of the task, the number of steps involved, and the model selected.
8+
> When you use the Chat view in agent mode, GitHub Copilot may make multiple premium requests to complete a single task. Premium requests can be used by user-initiated prompts and follow-up actions Copilot takes on your behalf. The total premium requests used depends on the complexity of the task, the number of steps involved, and the model selected.
99
10-
## Use the Chat view in Ask mode to create unit tests
10+
## Use the ask mode to create unit tests
1111

12-
The Ask mode can be used to analyze a workspace and then create unit tests. This is useful when you want to create tests for multiple functions or methods in a file, or when you want to create tests for an entire file.
12+
The ask mode can be used to analyze a workspace and then create unit tests. The ask mode is useful when you want to create tests for multiple functions or methods in a file, or when you want to create tests for an entire file.
1313

14-
To create unit tests using the Ask mode, follow these steps:
14+
To create unit tests using the ask mode, follow these steps:
1515

1616
1. Open the file that contains the code you want to test.
1717

18-
1. Open the Chat view and start a new chat session using the **Ask** mode.
18+
1. Open the Chat view and start a new chat session using the ask mode.
1919

2020
1. Add context to the chat session.
2121

2222
- You can add context to the chat session by dragging and dropping files from Visual Studio Code's EXPLORER view into the Chat view. You can also use the **Add Context** button.
23-
- You can open external files in the code editor to include resources that aren't part of the workspace and use them to provide additional context. For example, you can open markdown files that contain contributor guidelines or contact information and then use the **Add Context** button to add them to the Chat view context.
24-
- You can use the `@workspace` chat variable to specify the workspace as part of your prompt. This is useful when you want to create tests for multiple functions or methods in a file, or when you want to create tests for an entire file.
23+
- You can open external files in the code editor to include resources that aren't part of the workspace and use them to provide specific context. For example, you can open markdown files that contain contributor guidelines or contact information and then use the **Add Context** button to add them to the Chat view context.
24+
- You can use the `@workspace` chat variable to specify the workspace as part of your prompt. The workspace context is useful when you want to create tests for multiple functions or methods in a file, or when you want to create tests for an entire file.
2525

2626
1. Enter a prompt that asks for unit tests for the code in the file.
2727

28-
- For example: "`@workspace /explain` I need to create unit tests for the code in this file. The tests should be written in Python and use the unittest framework."
28+
- For example: "`@workspace /explain I need to create unit tests for the code in this file. The tests should be written in Python and use the unittest framework.`"
2929

30-
1. Review the suggested unit tests, and refine the results using additional prompts if necessary.
30+
1. Review the suggested unit tests, and refine the results using updated prompts if necessary.
3131

3232
1. Move the suggested unit tests into a test file.
3333

3434
- For example, create a test file in the same directory as the code file, and then insert the suggested unit tests into the file.
35-
- You can use the Ask mode to suggest updates for specific tests after creating the test file, or use other GitHub Copilot tools to help with updates.
35+
- You can use the ask mode to suggest updates for specific tests after creating the test file, or use other GitHub Copilot tools to help with updates.
3636
- You can also use the **Apply in Editor** button to apply the suggested unit tests directly to the code file.
3737

3838
1. Save the test file.
3939

40-
- Test files are typically saved to a separate "tests" directory in a project that's configured for unit tests. Your options will depend on your project's structure and testing framework.
41-
- You can use the Ask mode to suggest updates for specific tests after creating the test file, or use other GitHub Copilot tools to help with updates.
40+
- Test files are typically saved to a separate "tests" directory in a project that's configured for unit tests. Your options depend on your project's structure and testing framework.
41+
- You can use the ask mode to suggest updates for specific tests after creating the test file, or use other GitHub Copilot tools to help with updates.
4242

4343
1. Run the tests to ensure they pass and verify the functionality of your code.
4444

45-
1. If necessary, refine the tests by adding additional test cases or modifying existing ones.
45+
1. If necessary, refine the tests by adding more test cases or modifying existing ones.
4646

4747
1. Save the file again after making any changes to the tests.
4848

49-
## Use the Chat view in Edit mode to create unit tests
49+
## Use the edit mode to create unit tests
5050

51-
The Edit mode can be used to create unit tests by adding context files to the chat and then creating or updating test files. This is useful when you want to create tests for specific functions or methods in a file, or when you want to create tests for an entire file.
51+
The edit mode can be used to create unit tests by adding context files to the chat and then creating or updating test files. The edit mode is useful when you want to create tests for specific functions or methods in a file, or when you want to create tests for an entire file.
5252

53-
To create unit tests using the Edit mode, follow these steps:
53+
To create unit tests using the edit mode, follow these steps:
5454

5555
1. Open the file that contains the code you want to test.
5656

57-
1. Open the Chat view and start a new chat session using the **Edit** mode.
57+
1. Open the Chat view and start a new chat session using the edit mode.
5858

5959
1. Add context to the chat session.
6060

61-
- Chat participants aren't available in Edit mode, so you can't specify `@workspace` as part of your prompt. However, you can add context to the chat session using `#codebase` and by dragging and dropping files or folders from Visual Studio Code's EXPLORER view into the Chat view. Use Visual Studio Code to open external files, such markdown files that contain contributor guidelines, and then use the **Add Context** button to add them to the chat context.
61+
- Chat participants aren't available in edit mode, so you can't specify `@workspace` as part of your prompt. However, you can add context to the chat session using `#codebase` and by dragging and dropping files or folders from Visual Studio Code's EXPLORER view into the Chat view. Use Visual Studio Code to open external files, such markdown files that contain contributor guidelines, and then use the **Add Context** button to add them to the chat context.
6262

6363
1. Enter a prompt to create the intended unit tests.
6464

65-
- For example: "I need to create unit tests for the code in this file. The tests should be written in Python and use the unittest framework. Create a test file in the same directory as the code file."
65+
- For example: "`I need to create unit tests for the code in this file. The tests should be written in Python and use the unittest framework. Create a test file in the same directory as the code file.`"
6666

67-
1. Review the test file created using Edit mode, and then save or discard the file.
67+
1. Review the test file created using edit mode, and then save or discard the file.
6868

69-
- You can update the file using additional prompts to correct or enhance specific tests if necessary.
69+
- You can update the file using new prompts to correct or enhance specific tests if necessary.
7070

7171
1. Save the test file.
7272

73-
- Test files are typically saved to a separate "tests" directory in a project that's configured for unit tests. Your options will depend on your project's structure and testing framework.
73+
- Test files are typically saved to a separate "tests" directory in a project that's configured for unit tests. Your options depend on your project's structure and testing framework.
7474

7575
1. Run the tests to ensure they pass and verify the functionality of your code.
7676

77-
1. If necessary, refine the tests by adding additional test cases or modifying existing ones.
77+
1. If necessary, refine the tests by adding more test cases or modifying existing ones.
7878

7979
1. Save the file again after making any changes to the tests.
8080

81-
## Use the Chat view in Agent mode to create unit tests
81+
## Use the agent mode to create unit tests
8282

83-
The Agent mode can be used to automate tasks within your unit testing process. For example, you can use the Agent mode to scaffold a test project, create test files, run tests, generate test reports, or perform other tasks related to unit testing. The Agent mode is best for creating unit tests that require a more in-depth understanding of the project.
83+
The agent mode can be used to automate tasks within your unit testing process. For example, you can use the agent mode to scaffold a test project, create test files, run tests, generate test reports, or perform other tasks related to unit testing. The agent mode is best for creating unit tests that require a more in-depth understanding of the project.
8484

85-
To create unit tests using the Agent mode, follow these steps:
85+
To create unit tests using the agent mode, follow these steps:
8686

8787
1. Open the file that contains the code you want to test.
8888

8989
1. Open the Chat view and start a new chat session using the **Agent** mode.
9090

91-
1. Let Agent mode determine the context.
91+
1. Let agent mode determine the context.
9292

93-
In Agent mode, you don't need to specify the context. Copilot will automatically determine the relevant context and files to edit.
93+
In agent mode, you don't need to specify the context. Copilot will automatically determine the relevant context and files to edit.
9494

9595
1. Optionally, select the Tools icon to configure which tools can be used for responding to your request.
9696

@@ -99,17 +99,17 @@ To create unit tests using the Agent mode, follow these steps:
9999

100100
1. Enter a prompt that defines the intended tasks.
101101

102-
- For example: "Ensure that a suitable unit tests project is prepared for the selected code file. Create a test file in the unit test project that includes unit tests for all methods in the selected file. Unit tests should be written in C# and use the xUnit framework. Run the tests to ensure expected results."
102+
- For example: "`Ensure that a suitable unit tests project is prepared for the selected code file. Create a test file in the unit test project that includes unit tests for all methods in the selected file. Unit tests should be written in C# and use the xUnit framework. Run the tests to ensure expected results.`"
103103

104-
1. Monitor the progress of the Agent mode as it performs the tasks.
104+
1. Monitor the progress of the agent mode as it performs the tasks.
105105

106-
- Confirm tool invocations and terminal commands. You can confirm or reject the tool invocations and terminal commands that Agent mode suggests. For example, you can confirm the command to run the tests or the command to generate a test report.
107-
- Interrupt the Agent mode if necessary. You can interrupt the Agent mode if you want to stop the tasks that it's performing. For example, you can interrupt the Agent mode if you want to change the context or if you want to change the tools that are being used.
106+
- Confirm tool invocations and terminal commands. You can confirm or reject the tool invocations and terminal commands that agent mode suggests. For example, you can confirm the command to run the tests or the command to generate a test report.
107+
- Interrupt the agent mode if necessary. You can interrupt the agent mode if you want to stop the tasks that it's performing. For example, you can interrupt the agent mode if you want to change the context or if you want to change the tools that are being used.
108108

109-
1. Review the files tat Agent more created or updated during the specified tasks, and then keep or discard updates.
109+
1. Review the files that agent mode created or updated during the specified tasks, and then keep or discard updates.
110110

111-
- You can use additional prompts to correct or enhance specific tests if necessary.
111+
- You can use new prompts to correct or enhance specific tests if necessary.
112112

113113
## Summary
114114

115-
GitHub Copilot's Chat view provides three modes that can be used to create unit tests: Ask, Edit, and Agent. Each mode has its own strengths and weaknesses, and the best mode to use depends on the specific task at hand. The Ask mode is optimized for asking questions about your code projects, coding topics, and general technology concepts. The Edit mode is optimized for making edits across multiple files in your codebase. The Agent mode is optimized for starting an agentic coding workflow.
115+
GitHub Copilot's Chat view provides three modes that can be used to create unit tests: Ask, Edit, and Agent. Each mode has its own strengths and weaknesses, and the best mode to use depends on the specific task at hand. The ask mode is optimized for asking questions about your code projects, coding topics, and general technology concepts. The edit mode is optimized for making edits across multiple files in your codebase. The agent mode is optimized for starting an agentic coding workflow.

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/includes/6-exercise-develop-unit-tests-github-copliot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
> [!IMPORTANT]
2-
> To complete this exercise, you need an active GitHub account and a Visual Studio Code environment configured for C# development. For help configuring your lab environment, see [Configure lab environment for GitHub Copilot Labs](https://go.microsoft.com/fwlink/?linkid=2320147&azure-portal=true). For help enabling GitHub Copilot in Visual Studio Code, see [Enable GitHub Copilot in Visual Studio Code](https://go.microsoft.com/fwlink/?linkid=2320158&azure-portal=true).
2+
> To complete this exercise, you need an active GitHub account and a Visual Studio Code environment configured for C# development. For help with configuring your lab environment, see [Configure lab environment for GitHub Copilot Labs](https://go.microsoft.com/fwlink/?linkid=2320147&azure-portal=true). For help with enabling GitHub Copilot in Visual Studio Code, see [Enable GitHub Copilot in Visual Studio Code](https://go.microsoft.com/fwlink/?linkid=2320158&azure-portal=true).
33
44
In this exercise, you use GitHub Copilot to accelerate the development of unit tests for a C# application. Tasks include:
55

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ Additional Reading:
66

77
1. [GitHub Copilot documentation](https://docs.github.com/copilot)
88
1. [GitHub Copilot in Visual Studio Code](https://code.visualstudio.com/docs/copilot/overview)
9-
1. [GitHub Copilot: Your AI pair programmer](https://copilot.github.com/)
9+
1. [GitHub Copilot in Visual Studio Code - FAQ](https://code.visualstudio.com/docs/copilot/faq)
10+
1. [GitHub Copilot in Visual Studio Code - Cheat Sheet](https://code.visualstudio.com/docs/copilot/reference/copilot-vscode-features)
11+
1. [GitHub Copilot in Visual Studio Code - Workspace Context](https://code.visualstudio.com/docs/copilot/reference/workspace-context)
12+
1. [C# Dev Kit documentation](https://code.visualstudio.com/docs/csharp/csharp-dev-kit)
1013
1. [Testing with the C# Dev Kit](https://code.visualstudio.com/docs/csharp/testing)

learn-pr/wwl-azure/develop-unit-tests-using-github-copilot-tools/index.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ prerequisites: |
2727
2828
- Experience developing C# applications using Visual Studio Code and the C# Dev Kit extension is recommended.
2929
30-
- An active subscription for GitHub Copilot is required for either your personal GitHub account or a GitHub account managed by an organization or enterprise. You can set up a GitHub Copilot Free account or sign up for a subscription to GitHub Copilot Pro trial with a one-time 30-day trial. For learning, the Copilot Free option with usage limits should be sufficient.
30+
- An active subscription for GitHub Copilot is required for either your personal GitHub account or a GitHub account managed by an organization or enterprise. You can set up a GitHub Copilot Free plan or sign-up for a GitHub Copilot Pro subscription with a one-time 30-day free trial. For this training, signing up for a GitHub Copilot Free plan is sufficient.
3131
32-
- Awareness of the GitHub Copilot free trial conditions: if you choose the free trial offer for GitHub Copilot, a form of payment is requested at sign-up. Charges aren't applied until the trial is over, unless you cancel before the conclusion of the 30-day period.
32+
- Awareness of the GitHub Copilot free trial conditions: if you choose the 30-day free trial offer for GitHub Copilot Pro, a form of payment is requested at sign-up. Charges aren't applied until the trial is over, unless you cancel before the conclusion of the 30-day period.
3333
34-
- Experience using the GitHub Copilot and GitHub Copilot Chat extensions for Visual Studio Code to generate autocompletion suggestions and explain existing code.
34+
- Experience using GitHub Copilot in Visual Studio Code to explain, debug, and generate code.
3535
iconUrl: /training/achievements/generic-badge.svg
3636
levels:
3737
- intermediate

0 commit comments

Comments
 (0)