|
8 | 8 |
|
9 | 9 | The large language models behind GitHub Copilot are trained on a variety of code testing frameworks and scenarios. GitHub Copilot is a great tool for generating test cases, test methods, test assertions and mocks, and test data. In this exercise, you use GitHub Copilot to accelerate the development of unit tests for a C# application.
|
10 | 10 |
|
11 |
| -This exercise should take approximately **20** minutes to complete. |
| 11 | +This exercise should take approximately **25** minutes to complete. |
12 | 12 |
|
13 |
| -## Before you start |
14 |
| - |
15 |
| -Before you start this exercise, you need to complete the following tasks: |
16 |
| - |
17 |
| -1. Verify required tools and resources. |
18 |
| -1. Verify that GitHub Copilot is enabled in Visual Studio Code. |
19 |
| - |
20 |
| -### Verify required tools and resources |
21 |
| - |
22 |
| -This exercise requires a lab environment (either a hosted environment or a local PC) that's configured for C# development using Visual Studio Code and GitHub Copilot. Access to a GitHub account with GitHub Copilot enabled is required. |
23 |
| - |
24 |
| -Complete the following steps to verify that your lab environment is configured correctly: |
25 |
| - |
26 |
| -1. Verify that Git version 2.48 or later is installed in your lab environment. |
27 |
| - |
28 |
| - Run `git --version` in a terminal window to check the version of Git installed. |
29 |
| - |
30 |
| - If you're running Windows and you want to update Git, you can use the following command: |
31 |
| - |
32 |
| - ```bash |
33 |
| - git update-git-for-windows |
34 |
| - ``` |
35 |
| - |
36 |
| - If necessary, you can download Git using the following URL: <a href="https://git-scm.com/downloads" target="_blank">Download Git</a>. |
37 |
| - |
38 |
| -1. Verify that the latest LTS or STS version of the .NET SDK is installed in your lab environment. |
39 |
| - |
40 |
| - Run `dotnet --version` in a terminal window to check the version of the .NET SDK installed. |
41 |
| - |
42 |
| - If necessary, you can download the .NET SDK using the following URL: <a href="https://dotnet.microsoft.com/download/dotnet" target="_blank">Download .NET SDK</a>. |
43 |
| - |
44 |
| -1. Verify that Visual Studio Code and the C# Dev Kit extension are installed in your lab environment. |
45 |
| - |
46 |
| - If necessary, you can download Visual Studio Code using the following URL: <a href="https://code.visualstudio.com/download" target="_blank">Download Visual Studio Code</a> |
| 13 | +> **IMPORTANT**: If you don't have a GitHub account, you can <a href="https://go.microsoft.com/fwlink/?linkid=2320148" target="_blank">sign up</a> for a free individual account and use a GitHub Copilot Free plan to complete this exercise. If you have access to a GitHub Copilot Pro, GitHub Copilot Business, or GitHub Copilot Enterprise subscription from within your lab environment, you can use your existing GitHub Copilot subscription to complete this exercise. |
47 | 14 |
|
48 |
| - You can install the C# Dev Kit extension using the Extensions view in Visual Studio Code. |
49 |
| - |
50 |
| -1. Verify that you have access to a GitHub account and GitHub Copilot subscription. |
51 |
| - |
52 |
| - You can log in to your GitHub account using the following URL: <a href="https://github.com/login" target="_blank">GitHub login</a>. Check your GitHub account settings to verify that you have access to a GitHub Copilot subscription. |
53 |
| - |
54 |
| - > [!IMPORTANT] |
55 |
| - > If you don't have a GitHub account, you can create an individual account from the GitHub login page (select **Create an account**), and then activate the **GitHub Copilot Free** plan in the next section. If you have access to a GitHub Copilot Pro, GitHub Copilot Business, or GitHub Copilot Enterprise subscription from within the lab environment, you can use your existing GitHub Copilot subscription to complete this exercise. |
56 |
| -
|
57 |
| -### Configure the GitHub Copilot Free plan in Visual Studio Code |
58 |
| -
|
59 |
| -GitHub offers three Copilot plans for individual developers, and two plans for organizations and enterprises. The plans are designed to meet the needs of individual developers, teams, and organizations. The GitHub Copilot Free plan is available to all individual GitHub users, while the paid plans are available to individuals and organizations that require additional features and capabilities. |
60 |
| -
|
61 |
| -> [!NOTE] |
62 |
| -> If you've already verified access to a GitHub Copilot subscription in your lab environment, you can skip this section and proceed to the exercise scenario. |
63 |
| - |
64 |
| -Complete the following steps to verify that your lab environment is configured correctly: |
65 |
| - |
66 |
| -1. Open Visual Studio Code. |
67 |
| - |
68 |
| -1. On the Visual Studio Code Status Bar, to activate GitHub Copilot, hover the mouse pointer over the Copilot icon, and then select **Set up Copilot**. |
69 |
| - |
70 |
| -  |
71 |
| - |
72 |
| -1. On the **Sign in to use Copilot for free** page, select **Sign in**. |
73 |
| - |
74 |
| - The GitHub account sign in page opens in your default web browser. |
75 |
| - |
76 |
| -1. On the GitHub sign in page, enter the GitHub account credentials that you'll be using for this exercise, and then select **Sign in**. |
77 |
| -
|
78 |
| -1. Follow the online instructions to authenticate your account and authorize access in Visual Studio Code. |
79 |
| -
|
80 |
| - You'll be directed back to Visual Studio Code when the authentication/authorization process is complete. |
| 15 | +## Before you start |
81 | 16 |
|
82 |
| -1. To verify that GitHub Copilot is activated, open Visual Studio Code's **Extensions** view. |
| 17 | +Your lab environment must include the following: Git 2.48 or later, .NET SDK 9.0 or later, Visual Studio Code with the C# Dev Kit extension, and access to a GitHub account with GitHub Copilot enabled. |
83 | 18 |
|
84 |
| - You should see the GitHub Copilot and GitHub Copilot Chat extensions listed in the **Installed** section of the Extensions view. |
| 19 | +- If you're using your local PC and need help configuring the lab environment, use the following instructions: <a href="https://go.microsoft.com/fwlink/?linkid=2320147" target="_blank">Configure your lab environment resources</a>. |
85 | 20 |
|
86 |
| -c |
87 |
| -You're now ready to complete the exercise. |
| 21 | +- If you're using a hosted lab environment, or you need help enabling GitHub Copilot within Visual Studio Code, use the following instructions: <a href="https://go.microsoft.com/fwlink/?linkid=2320158" target="_blank">Enable GitHub Copilot within Visual Studio Code</a>. |
88 | 22 |
|
89 | 23 | ## Exercise scenario
|
90 | 24 |
|
|
0 commit comments