Skip to content

Commit d9a1b19

Browse files
committed
fix path to net8.0 testing dll now that this project multi-targets
1 parent 6c59f5c commit d9a1b19

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

docs/content/Unit Testing.fsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ index: 5
88
# Unit testing an analyzer
99
1010
To help analyzer authors testing their analyzers, there's a dedicated [testing package](https://www.nuget.org/packages/FSharp.Analyzers.SDK.Testing).
11-
It contains easy to use utility functions to create a context for the analyzer and assertion helpers.
11+
It contains easy to use utility functions to create a context for the analyzer and assertion helpers.
1212
13-
[`FSharp.Analyzers.SDK.Testing.mkOptionsFromProject`](../reference/fsharp-analyzers-sdk-testing.html#mkOptionsFromProject) creates the [`FSharpProjectOptions`](https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-codeanalysis-fsharpprojectoptions.html) for the given framework (e.g. `net7.0`) and the given list of packages to reference.
14-
[`FSharp.Analyzers.SDK.Testing.getContext`](../reference/fsharp-analyzers-sdk-testing.html#getContext) then takes the `FSharpProjectOptions` and the source code to test and creates a [`CliContext`](../reference/fsharp-analyzers-sdk-clicontext.html) you can pass along to your analyzer function.
15-
The module [`FSharp.Analyzers.SDK.Testing.Assert`](../reference/fsharp-analyzers-sdk-testing-assert.html) offers various functions to help with assertion statements from your favorite unit testing framework.
13+
[`FSharp.Analyzers.SDK.Testing.mkOptionsFromProject`](../reference/fsharp-analyzers-sdk-testing.html#mkOptionsFromProject) creates the [`FSharpProjectOptions`](https://fsharp.github.io/fsharp-compiler-docs/reference/fsharp-compiler-codeanalysis-fsharpprojectoptions.html) for the given framework (e.g. `net7.0`) and the given list of packages to reference.
14+
[`FSharp.Analyzers.SDK.Testing.getContext`](../reference/fsharp-analyzers-sdk-testing.html#getContext) then takes the `FSharpProjectOptions` and the source code to test and creates a [`CliContext`](../reference/fsharp-analyzers-sdk-clicontext.html) you can pass along to your analyzer function.
15+
The module [`FSharp.Analyzers.SDK.Testing.Assert`](../reference/fsharp-analyzers-sdk-testing-assert.html) offers various functions to help with assertion statements from your favorite unit testing framework.
1616
For a complete example of an unit testing project, take a look at [`OptionAnalyzer.Test`](https://github.com/ionide/FSharp.Analyzers.SDK/tree/7b7ec530c507d765ab18d93ebb7aa45ab59accc2/samples/OptionAnalyzer.Test) in the `samples` folder of the SDK repository.
1717
*)
1818

1919
(*** hide ***)
2020
#r "../../artifacts/bin/FSharp.Analyzers.Cli/release/FSharp.Compiler.Service.dll"
2121
#r "../../artifacts/bin/FSharp.Analyzers.SDK/release/FSharp.Analyzers.SDK.dll"
22-
#r "../../artifacts/bin/FSharp.Analyzers.SDK.Testing/release/FSharp.Analyzers.SDK.Testing.dll"
22+
#r "../../artifacts/bin/FSharp.Analyzers.SDK.Testing/release_net8.0/FSharp.Analyzers.SDK.Testing.dll"
2323
#r "../../artifacts/bin/OptionAnalyzer.Test/release/nunit.framework.dll"
2424
#r "../../artifacts/bin/OptionAnalyzer.Test/release/OptionAnalyzer.dll"
2525
(** *)
@@ -38,13 +38,10 @@ let Setup () =
3838
mkOptionsFromProject
3939
"net7.0"
4040
[
41-
// The SDK uses this in a "dotnet add package x --version y" command
42-
// to generate the needed FSharpProjectOptions
43-
{
44-
Name = "Newtonsoft.Json"
45-
Version = "13.0.3"
46-
}
47-
]
41+
// The SDK uses this in a "dotnet add package x --version y" command
42+
// to generate the needed FSharpProjectOptions
43+
{ Name = "Newtonsoft.Json"
44+
Version = "13.0.3" } ]
4845

4946
projectOptions <- opts
5047
}

0 commit comments

Comments
 (0)