@@ -5,70 +5,71 @@ namespace FSharp.Compiler.Scripting.UnitTests
5
5
open System
6
6
open System.Threading .Tasks
7
7
open FSharp.Compiler .Scripting
8
- open Xunit
8
+ open NUnit. Framework
9
9
10
+ [<TestFixture>]
10
11
type CompletionTests () =
11
12
12
- [<Fact >]
13
+ [<Test >]
13
14
member _. ``Instance completions in the same submission`` () =
14
15
async {
15
16
use script = new FSharpScript()
16
17
let lines = [ " let x = 1"
17
18
" x." ]
18
19
let! completions = script.GetCompletionItems( String.Join( " \n " , lines), 2 , 2 )
19
20
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " CompareTo" )
20
- Assert.Equal ( 1 , matchingCompletions.Length)
21
+ Assert.AreEqual ( 1 , matchingCompletions.Length)
21
22
} |> Async.StartAsTask :> Task
22
23
23
- [<Fact >]
24
+ [<Test >]
24
25
member _. ``Instance completions from a previous submission`` () =
25
26
async {
26
27
use script = new FSharpScript()
27
28
script.Eval( " let x = 1" ) |> ignoreValue
28
29
let! completions = script.GetCompletionItems( " x." , 1 , 2 )
29
30
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " CompareTo" )
30
- Assert.Equal ( 1 , matchingCompletions.Length)
31
+ Assert.AreEqual ( 1 , matchingCompletions.Length)
31
32
} |> Async.StartAsTask :> Task
32
33
33
- [<Fact >]
34
+ [<Test >]
34
35
member _. ``Completions from types that try to pull in Windows runtime extensions`` () =
35
36
async {
36
37
use script = new FSharpScript()
37
38
script.Eval( " open System" ) |> ignoreValue
38
39
script.Eval( " let t = TimeSpan.FromHours(1.0)" ) |> ignoreValue
39
40
let! completions = script.GetCompletionItems( " t." , 1 , 2 )
40
41
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " TotalHours" )
41
- Assert.Equal ( 1 , matchingCompletions.Length)
42
+ Assert.AreEqual ( 1 , matchingCompletions.Length)
42
43
} |> Async.StartAsTask :> Task
43
44
44
- [<Fact >]
45
+ [<Test >]
45
46
member _. ``Static member completions`` () =
46
47
async {
47
48
use script = new FSharpScript()
48
49
let! completions = script.GetCompletionItems( " System.String." , 1 , 14 )
49
50
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " Join" )
50
- Assert.True ( matchingCompletions.Length >= 1 )
51
+ Assert.GreaterOrEqual ( matchingCompletions.Length, 1 )
51
52
} |> Async.StartAsTask :> Task
52
53
53
- [<Fact >]
54
+ [<Test >]
54
55
member _. ``Type completions from namespace`` () =
55
56
async {
56
57
use script = new FSharpScript()
57
58
let! completions = script.GetCompletionItems( " System." , 1 , 7 )
58
59
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " String" )
59
- Assert.True ( matchingCompletions.Length >= 1 )
60
+ Assert.GreaterOrEqual ( matchingCompletions.Length, 1 )
60
61
} |> Async.StartAsTask :> Task
61
62
62
- [<Fact >]
63
+ [<Test >]
63
64
member _. ``Namespace completions`` () =
64
65
async {
65
66
use script = new FSharpScript()
66
67
let! completions = script.GetCompletionItems( " System." , 1 , 7 )
67
68
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " Collections" )
68
- Assert.Equal ( 1 , matchingCompletions.Length)
69
+ Assert.AreEqual ( 1 , matchingCompletions.Length)
69
70
} |> Async.StartAsTask :> Task
70
71
71
- [<Fact >]
72
+ [<Test >]
72
73
member _. ``Extension method completions`` () =
73
74
async {
74
75
use script = new FSharpScript()
@@ -77,5 +78,5 @@ type CompletionTests() =
77
78
" list." ]
78
79
let! completions = script.GetCompletionItems( String.Join( " \n " , lines), 3 , 5 )
79
80
let matchingCompletions = completions |> Array.filter ( fun d -> d.Name = " Select" )
80
- Assert.Equal ( 1 , matchingCompletions.Length)
81
+ Assert.AreEqual ( 1 , matchingCompletions.Length)
81
82
} |> Async.StartAsTask :> Task
0 commit comments