@@ -8,19 +8,40 @@ type TestConventionsCSharpFriendlyAsyncOverload() =
8
8
inherit TestAstNodeRuleBase.TestAstNodeRuleBase( CSharpFriendlyAsyncOverload.rule)
9
9
10
10
[<Test>]
11
- member this. ``async function must suggest friendly implementation `` () =
11
+ member this. ``async function should have the prefix Async `` () =
12
12
this.Parse( """
13
13
module Foo =
14
14
let Bar(): Async<unit> =
15
15
Async.Sleep 5""" )
16
16
17
17
Assert.IsTrue( this.ErrorExistsAt( 3 , 8 ))
18
+
19
+ [<Test>]
20
+ member this. ``async function should have the prefix Async 2`` () =
21
+ this.Parse( """
22
+ module Foo =
23
+ let Bar(): Async<unit> =
24
+ Async.Sleep 5
25
+ let BarAsync(): Task<unit> =
26
+ Bar() |> Async.StartAsTask""" )
27
+
28
+ Assert.IsTrue( this.ErrorExistsAt( 3 , 8 ))
29
+
30
+
31
+ [<Test>]
32
+ member this. ``async function must suggest friendly implementation`` () =
33
+ this.Parse( """
34
+ module Foo =
35
+ let AsyncBar(): Async<unit> =
36
+ Async.Sleep 5""" )
37
+
38
+ Assert.IsTrue( this.ErrorExistsAt( 3 , 8 ))
18
39
19
40
[<Test>]
20
41
member this. ``async function with friendly implementation must not have errors`` () =
21
42
this.Parse( """
22
43
module Foo =
23
- let Bar (): Async<unit> =
44
+ let AsyncBar (): Async<unit> =
24
45
Async.Sleep 5
25
46
let BarAsync(): Task<unit> =
26
47
Bar() |> Async.StartAsTask""" )
@@ -40,7 +61,7 @@ module Foo =
40
61
member this. ``async function must not have errors when not delcared immediately following the parent function`` () =
41
62
this.Parse( """
42
63
module Foo =
43
- let Bar (): Async<unit> =
64
+ let AsyncBar (): Async<unit> =
44
65
Async.Sleep 5
45
66
let RandomFunction() =
46
67
()
@@ -53,13 +74,13 @@ module Foo =
53
74
member this. ``multiple async functions must have errors`` () =
54
75
this.Parse( """
55
76
module Foo =
56
- let Bar (): Async<unit> =
77
+ let AsyncBar (): Async<unit> =
57
78
Async.Sleep 5
58
79
let RandomFunction() =
59
80
()
60
81
let BarAsync(): Task<unit> =
61
82
Bar() |> Async.StartAsTask
62
- let Foo (): Async<unit> =
83
+ let AsyncFoo (): Async<unit> =
63
84
Async.Sleep 10""" )
64
85
65
86
Assert.IsTrue( this.ErrorExistsAt( 9 , 8 ))
@@ -68,13 +89,13 @@ module Foo =
68
89
member this. ``multiple async functions must not have errors`` () =
69
90
this.Parse( """
70
91
module Foo =
71
- let Bar (): Async<unit> =
92
+ let AsyncBar (): Async<unit> =
72
93
Async.Sleep 5
73
94
let RandomFunction() =
74
95
()
75
96
let BarAsync(): Task<unit> =
76
97
Bar() |> Async.StartAsTask
77
- let Foo (): Async<unit> =
98
+ let AsyncFoo (): Async<unit> =
78
99
Async.Sleep 10
79
100
let FooAsync(): Task<unit> =
80
101
Foo() |> Async.StartAsTask""" )
0 commit comments