Skip to content

Commit

Permalink
Adds a document about the fakes extension in MSTest Runner (dotnet#41517
Browse files Browse the repository at this point in the history
)

* Adds a document about the fakes extension in MSTest Runner

* Add a trailing newline

* Fix the fakes extension md

Fix typo
Create a subheading

* Remove the absolute URL portion from Fakes link

* Apply suggestions from code review

---------

Co-authored-by: David Pine <[email protected]>
  • Loading branch information
drognanar and IEvangelist authored Jun 26, 2024
1 parent 073c21f commit 255711d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/core/testing/unit-testing-platform-extensions-fakes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Microsoft.Testing.Platform Fakes extension
description: Learn about the various Microsoft.Testing.Platform Fakes extension capabilities and how to use it.
author: drognanar
ms.author: arturs
ms.date: 06/21/2024
---

# Fakes extension

The `Microsoft.Testing.Extensions.Fakes` extension provides support to execute a test project that makes use of `Microsoft Fakes`.

[Microsoft Fakes](/visualstudio/test/isolating-code-under-test-with-microsoft-fakes) allows you to better test your code by either generating `Stub`s (for instance creating a testable implementation of `INotifyPropertyChanged`) or by `Shim`ing methods and static methods (replacing the implementation of `File.Open` with a one you can control in your tests).

> [!NOTE]
> This extension requires a Visual Studio Enterprise installation with the minimum version of 17.11 preview 1 in order to work correctly.
## Upgrade your project to the new extension

To use the new extension with an existing project, update the existing `Microsoft.QualityTools.Testing.Fakes` reference with `Microsoft.Testing.Extensions.Fakes`.

```diff
- <Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=Neutral">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
+ <PackageReference Include="Microsoft.Testing.Extensions.Fakes" Version="17.11.0-beta.24319.3" />
```
4 changes: 4 additions & 0 deletions docs/core/testing/unit-testing-platform-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ Extensions allowing to produce test report files that contains information about
**[VSTest Bridge](./unit-testing-platform-extensions-vstest-bridge.md)**

This extension provides a compatibility layer with VSTest allowing the test frameworks depending on it to continue supporting running in VSTest mode (`vstest.console.exe`, usual `dotnet test`, `VSTest task` on AzDo, Test Explorers of Visual Studio and Visual Studio Code...).

**[Microsoft Fakes](./unit-testing-platform-extensions-fakes.md)**

This extension provides support to execute a test project that makes use of `Microsoft Fakes`.

0 comments on commit 255711d

Please sign in to comment.