Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit 699964d

Browse files
dotnet-botbrettfo
authored andcommitted
don't auto-resolve types from System.Runtime.WindowsRuntime (dotnet#9644) (dotnet#9646)
Co-authored-by: Brett V. Forsgren <brettfo@microsoft.com>
1 parent 7c76069 commit 699964d

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

tests/FSharp.Compiler.Private.Scripting.UnitTests/CompletionTests.fs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,71 @@ namespace FSharp.Compiler.Scripting.UnitTests
55
open System
66
open System.Threading.Tasks
77
open FSharp.Compiler.Scripting
8-
open Xunit
8+
open NUnit.Framework
99

10+
[<TestFixture>]
1011
type CompletionTests() =
1112

12-
[<Fact>]
13+
[<Test>]
1314
member _.``Instance completions in the same submission``() =
1415
async {
1516
use script = new FSharpScript()
1617
let lines = [ "let x = 1"
1718
"x." ]
1819
let! completions = script.GetCompletionItems(String.Join("\n", lines), 2, 2)
1920
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "CompareTo")
20-
Assert.Equal(1, matchingCompletions.Length)
21+
Assert.AreEqual(1, matchingCompletions.Length)
2122
} |> Async.StartAsTask :> Task
2223

23-
[<Fact>]
24+
[<Test>]
2425
member _.``Instance completions from a previous submission``() =
2526
async {
2627
use script = new FSharpScript()
2728
script.Eval("let x = 1") |> ignoreValue
2829
let! completions = script.GetCompletionItems("x.", 1, 2)
2930
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "CompareTo")
30-
Assert.Equal(1, matchingCompletions.Length)
31+
Assert.AreEqual(1, matchingCompletions.Length)
3132
} |> Async.StartAsTask :> Task
3233

33-
[<Fact>]
34+
[<Test>]
3435
member _.``Completions from types that try to pull in Windows runtime extensions``() =
3536
async {
3637
use script = new FSharpScript()
3738
script.Eval("open System") |> ignoreValue
3839
script.Eval("let t = TimeSpan.FromHours(1.0)") |> ignoreValue
3940
let! completions = script.GetCompletionItems("t.", 1, 2)
4041
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "TotalHours")
41-
Assert.Equal(1, matchingCompletions.Length)
42+
Assert.AreEqual(1, matchingCompletions.Length)
4243
} |> Async.StartAsTask :> Task
4344

44-
[<Fact>]
45+
[<Test>]
4546
member _.``Static member completions``() =
4647
async {
4748
use script = new FSharpScript()
4849
let! completions = script.GetCompletionItems("System.String.", 1, 14)
4950
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Join")
50-
Assert.True(matchingCompletions.Length >= 1)
51+
Assert.GreaterOrEqual(matchingCompletions.Length, 1)
5152
} |> Async.StartAsTask :> Task
5253

53-
[<Fact>]
54+
[<Test>]
5455
member _.``Type completions from namespace``() =
5556
async {
5657
use script = new FSharpScript()
5758
let! completions = script.GetCompletionItems("System.", 1, 7)
5859
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "String")
59-
Assert.True(matchingCompletions.Length >= 1)
60+
Assert.GreaterOrEqual(matchingCompletions.Length, 1)
6061
} |> Async.StartAsTask :> Task
6162

62-
[<Fact>]
63+
[<Test>]
6364
member _.``Namespace completions``() =
6465
async {
6566
use script = new FSharpScript()
6667
let! completions = script.GetCompletionItems("System.", 1, 7)
6768
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Collections")
68-
Assert.Equal(1, matchingCompletions.Length)
69+
Assert.AreEqual(1, matchingCompletions.Length)
6970
} |> Async.StartAsTask :> Task
7071

71-
[<Fact>]
72+
[<Test>]
7273
member _.``Extension method completions``() =
7374
async {
7475
use script = new FSharpScript()
@@ -77,5 +78,5 @@ type CompletionTests() =
7778
"list." ]
7879
let! completions = script.GetCompletionItems(String.Join("\n", lines), 3, 5)
7980
let matchingCompletions = completions |> Array.filter (fun d -> d.Name = "Select")
80-
Assert.Equal(1, matchingCompletions.Length)
81+
Assert.AreEqual(1, matchingCompletions.Length)
8182
} |> Async.StartAsTask :> Task

0 commit comments

Comments
 (0)