Koolitus
Moodul
C# testing in Visual Studio - Training
Start testing your C# apps by using the testing tools in Visual Studio. Learn to write tests, use Test Explorer, create test suites, and apply the red, green, refactor pattern to write code.
Seda brauserit enam ei toetata.
Uusimate funktsioonide, turbevärskenduste ja tehnilise toe kasutamiseks võtke kasutusele Microsoft Edge.
Test runs in Visual Studio involve building the project to update the binaries on disk before using Test Platform to execute your tests. The build time inside Visual Studio can vary depending on the kind of changes made to the code. For larger solutions, builds can be the most expensive part of the test run. In Visual Studio 2022 and later, test execution with hot reload can be enabled to speed up test execution by skipping builds for supported scenarios.
Enable this feature by choosing Test > Options > "(Experimental) Enable Hot Reloaded Test Runs for C# and VB test projects targeting .NET 6 and higher".
This is a new way of test execution where we change a widely used path of validating code. We also expect the user experience around this feature to change as we receive more feedback from users. For these two reasons, we have currently labeled this feature as "experimental".
Once the option is enabled, Test Explorer will automatically use test execution with hot reload when possible. If a hot reload is not possible, it will fall back to the regular behavior of building and running tests. As a user running tests, you do not need to make any changes to your workflow (that is, continue to edit code and run tests).
Under the hood, we are using the same Edit and Continue infrastructure that exists in the newly released Hot Reload experience for editing C#/VB code at runtime to determine the changes made. For this reason, we hot reload only when there are no "rude edits", in which case we fall back to building your tests before executing them. For more details on supported edits, read the Edit and Continue documentation
There are many variables that come into play when estimating how much time this feature will save you. For example:
Ultimately, the speed improvements will be directly related to the build time that would have occurred in that specific test run.
As noted before, for this experimental feature to be complete we require your feedback. If you have a suggestion for how the experience should be, or encounter any problems, please take a moment to report issues to us. Only with your feedback can we ensure that critical problems are resolved, and future decisions are prioritized based on your input.
To reach us please use the Visual Studio feedback mechanism.
Koolitus
Moodul
C# testing in Visual Studio - Training
Start testing your C# apps by using the testing tools in Visual Studio. Learn to write tests, use Test Explorer, create test suites, and apply the red, green, refactor pattern to write code.
Dokumentatsioon
Introduction Live Unit Testing - Visual Studio (Windows)
Explore the advantages of Live Unit Testing, which executes unit tests automatically and in real time as you make code changes.
Run Unit Tests with Test Explorer - Visual Studio (Windows)
Run tests by using Test Explorer in Visual Studio, enable automatic tests after build, view results, group and filter the test list, create playlists, and use shortcuts.
Configure and use Live Unit Testing - Visual Studio (Windows)
Learn about Live Unit Testing during application development, including supported frameworks and how to configure Live Unit Testing.