You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/test/code-generation-compilation-and-naming-conventions-in-microsoft-fakes.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ This article discusses options and issues in Fakes code generation and compilati
16
16
17
17
- Visual Studio Enterprise
18
18
- A .NET Framework project
19
-
20
-
> [!NOTE]
21
-
> .NET Standard projects are not supported.
19
+
::: moniker range=">=vs-2019"
20
+
- .NET Core and SDK-style project support previewed in Visual Studio 2019 Update 6, and is enabled by default in Update 8. For more information, see [Microsoft Fakes for .NET Core and SDK-style projects](/visualstudio/releases/2019/release-notes#microsoft-fakes-for-net-core-and-sdk-style-projects).
Copy file name to clipboardExpand all lines: docs/test/isolating-code-under-test-with-microsoft-fakes.md
+66-6Lines changed: 66 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,11 @@ Fakes come in two flavors:
27
27
28
28
- Visual Studio Enterprise
29
29
- A .NET Framework project
30
-
- .NET Core and SDK-style project support is currently in preview. [Read More](/visualstudio/releases/2019/release-notes#microsoft-fakes-for-net-core-and-sdk-style-projects)
30
+
::: moniker range=">=vs-2019"
31
+
- .NET Core and SDK-style project support previewed in Visual Studio 2019 Update 6, and is enabled by default in Update 8. For more information, see [Microsoft Fakes for .NET Core and SDK-style projects](/visualstudio/releases/2019/release-notes#microsoft-fakes-for-net-core-and-sdk-style-projects).
32
+
::: moniker-end
31
33
32
34
> [!NOTE]
33
-
> - .NET Standard projects are not supported.
34
35
> - Profiling with Visual Studio is not available for tests that use Microsoft Fakes.
35
36
36
37
## Choose between stub and shim types
@@ -76,11 +77,15 @@ For a more detailed description, see [Use stubs to isolate parts of your applica
76
77
77
78
2. **AddFakesAssembly**
78
79
79
-
1. In**SolutionExplorer**, expandthetestproject's reference list. If you are working in Visual Basic, you must choose **Show All Files** in order to see the reference list.
-Ifyou're working in Visual Basic, select **Show All Files** in the **Solution Explorer** toolbar to see the **References** node.
86
+
2. Selecttheassemblythatcontainstheclassdefinitions for which you want to create shims. For example, if you want to shim **DateTime**, select **System.dll**.
80
87
81
-
2. Selectthereferencetotheassemblyinwhichthe interface (for example IStockFeed) is defined. On the shortcut menu of this reference, choose **Add Fakes Assembly**.
82
-
83
-
3. Rebuild the solution.
88
+
3. On the shortcut menu, choose **Add Fakes Assembly**.
84
89
85
90
3. In your tests, construct instances of the stub and provide code for its methods:
Copy file name to clipboardExpand all lines: docs/test/using-shims-to-isolate-your-application-from-other-assemblies-for-unit-testing.md
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ For an overview and "quick start" guidance, see [Isolate code under test with Mi
22
22
23
23
- Visual Studio Enterprise
24
24
- A .NET Framework project
25
-
26
-
> [!NOTE]
27
-
> .NET Standard projects are not supported.
25
+
::: moniker range=">=vs-2019"
26
+
- .NET Core and SDK-style project support previewed in Visual Studio 2019 Update 6, and is enabled by default in Update 8. For more information, see [Microsoft Fakes for .NET Core and SDK-style projects](/visualstudio/releases/2019/release-notes#microsoft-fakes-for-net-core-and-sdk-style-projects).
27
+
::: moniker-end
28
28
29
29
## Example: The Y2K bug
30
30
@@ -61,9 +61,12 @@ using (ShimsContext.Create()) {
61
61
62
62
First, add a Fakes assembly:
63
63
64
-
1. In **Solution Explorer**, expand your unit test project's **References** node.
65
-
66
-
- If you're working in Visual Basic, select **Show All Files** in the **Solution Explorer** toolbar in order to see the **References** node.
64
+
1. In **Solution Explorer**,
65
+
- For an older .NET Framework Project (non-SDK style), expand your unit test project's **References** node.
66
+
::: moniker range=">=vs-2019"
67
+
- For an SDK-style project targeting .NET Framework or .NET Core, expand the **Dependencies** node to find the assembly you would like to fake under **Assemblies**, **Projects**, or **Packages**.
68
+
::: moniker-end
69
+
- If you're working in Visual Basic, select **Show All Files** in the **Solution Explorer** toolbar to see the **References** node.
67
70
68
71
2. Select the assembly that contains the class definitions for which you want to create shims. For example, if you want to shim **DateTime**, select **System.dll**.
Copy file name to clipboardExpand all lines: docs/test/using-stubs-to-isolate-parts-of-your-application-from-each-other-for-unit-testing.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -141,11 +141,14 @@ To use stubs, you must first generate stub types from the interface definitions.
141
141
142
142
#### Add a Fakes Assembly
143
143
144
-
1. In **Solution Explorer**, expand your unit test project's **References**.
145
-
146
-
If you're working in Visual Basic, select **Show All Files** in the **Solution Explorer** toolbar in order to see the **References** node.
147
-
148
-
2. Select the assembly that contains the interface definitions for which you want to create stubs.
144
+
1. In **Solution Explorer**,
145
+
- For an older .NET Framework Project (non-SDK style), expand your unit test project's **References** node.
146
+
::: moniker range=">=vs-2019"
147
+
- For an SDK-style project targeting .NET Framework or .NET Core, expand the **Dependencies** node to find the assembly you would like to fake under **Assemblies**, **Projects**, or **Packages**.
148
+
::: moniker-end
149
+
- If you're working in Visual Basic, select **Show All Files** in the **Solution Explorer** toolbar to see the **References** node.
150
+
151
+
2. Select the assembly that contains the class definitions for which you want to create shims. For example, if you want to shim **DateTime**, select **System.dll**.
149
152
150
153
3. On the shortcut menu, choose **Add Fakes Assembly**.
0 commit comments