Skip to content

Commit 9639a7c

Browse files
committed
Added Execution trait to all integration tests to mark async or sync
1 parent cbf81af commit 9639a7c

File tree

4 files changed

+52
-52
lines changed

4 files changed

+52
-52
lines changed

tests/FSharp.Data.GraphQL.IntegrationTests/LocalProviderTests.fs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,131 +56,131 @@ module SimpleOperation =
5656
let output = result.Data.Value.Echo.Value.Single.Value |> map (fun x -> x.Int, x.IntOption, x.String, x.StringOption, x.Uri, x.Guid)
5757
input |> equals output))
5858

59-
[<Fact>]
59+
[<Fact; Trait("Execution", "Sync")>]
6060
let ``Should be able to execute a query without sending input field``() =
6161
SimpleOperation.operation.Run()
6262
|> SimpleOperation.validateResult None
6363

64-
[<Fact>]
64+
[<Fact; Trait("Execution", "Sync")>]
6565
let ``Should be able to execute a query using context, without sending input field``() =
6666
SimpleOperation.operation.Run(context)
6767
|> SimpleOperation.validateResult None
6868

69-
[<Fact>]
69+
[<Fact; Trait("Execution", "Async")>]
7070
let ``Should be able to execute a query without sending input field asynchronously``() : Task = task {
7171
let! result = SimpleOperation.operation.AsyncRun()
7272
result |> SimpleOperation.validateResult None
7373
}
7474

75-
[<Fact>]
75+
[<Fact; Trait("Execution", "Async")>]
7676
let ``Should be able to execute a query using context, without sending input field, asynchronously``() : Task = task {
7777
let! result = SimpleOperation.operation.AsyncRun(context)
7878
result |> SimpleOperation.validateResult None
7979
}
8080

81-
[<Fact>]
81+
[<Fact; Trait("Execution", "Sync")>]
8282
let ``Should be able to execute a query sending an empty input field``() =
8383
let input = Input()
8484
SimpleOperation.operation.Run(input)
8585
|> SimpleOperation.validateResult (Some input)
8686

87-
[<Fact>]
87+
[<Fact; Trait("Execution", "Sync")>]
8888
let ``Should be able to execute a query using context, sending an empty input field``() =
8989
let input = Input()
9090
SimpleOperation.operation.Run(context, input)
9191
|> SimpleOperation.validateResult (Some input)
9292

93-
[<Fact>]
93+
[<Fact; Trait("Execution", "Async")>]
9494
let ``Should be able to execute a query without sending an empty input field asynchronously``() : Task = task {
9595
let input = Input()
9696
let! result = SimpleOperation.operation.AsyncRun(input)
9797
result |> SimpleOperation.validateResult (Some input)
9898
}
9999

100-
[<Fact>]
100+
[<Fact; Trait("Execution", "Async")>]
101101
let ``Should be able to execute a query using context, sending an empty input field, asynchronously``() : Task = task {
102102
let input = Input()
103103
let! result = SimpleOperation.operation.AsyncRun(context, input)
104104
result |> SimpleOperation.validateResult (Some input)
105105
}
106106

107-
[<Fact>]
107+
[<Fact; Trait("Execution", "Sync")>]
108108
let ``Should be able to execute a query sending an input field with single field``() =
109109
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
110110
let input = Input(single)
111111
SimpleOperation.operation.Run(input)
112112
|> SimpleOperation.validateResult (Some input)
113113

114-
[<Fact>]
114+
[<Fact; Trait("Execution", "Sync")>]
115115
let ``Should be able to execute a query using context, sending an input field with single field``() =
116116
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
117117
let input = Input(single)
118118
SimpleOperation.operation.Run(context, input)
119119
|> SimpleOperation.validateResult (Some input)
120120

121-
[<Fact>]
121+
[<Fact; Trait("Execution", "Async")>]
122122
let ``Should be able to execute a query without sending an input field with single field asynchronously``() : Task = task {
123123
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
124124
let input = Input(single)
125125
let! result = SimpleOperation.operation.AsyncRun(input)
126126
result |> SimpleOperation.validateResult (Some input)
127127
}
128128

129-
[<Fact>]
129+
[<Fact; Trait("Execution", "Async")>]
130130
let ``Should be able to execute a query using context, sending an input field with single field, asynchronously``() : Task = task {
131131
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
132132
let input = Input(single)
133133
let! result = SimpleOperation.operation.AsyncRun(context, input)
134134
result |> SimpleOperation.validateResult (Some input)
135135
}
136136

137-
[<Fact>]
137+
[<Fact; Trait("Execution", "Sync")>]
138138
let ``Should be able to execute a query sending an input field with list field``() =
139139
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
140140
let input = Input(list)
141141
SimpleOperation.operation.Run(input)
142142
|> SimpleOperation.validateResult (Some input)
143143

144-
[<Fact>]
144+
[<Fact; Trait("Execution", "Sync")>]
145145
let ``Should be able to execute a query using context, sending an input field with list field``() =
146146
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
147147
let input = Input(list)
148148
SimpleOperation.operation.Run(context, input)
149149
|> SimpleOperation.validateResult (Some input)
150150

151-
[<Fact>]
151+
[<Fact; Trait("Execution", "Async")>]
152152
let ``Should be able to execute a query without sending an input field with list field asynchronously``() : Task = task {
153153
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
154154
let input = Input(list)
155155
let! result = SimpleOperation.operation.AsyncRun(input)
156156
result |> SimpleOperation.validateResult (Some input)
157157
}
158158

159-
[<Fact>]
159+
[<Fact; Trait("Execution", "Async")>]
160160
let ``Should be able to execute a query using context, sending an input field with list field, asynchronously``() : Task = task {
161161
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
162162
let input = Input(list)
163163
let! result = SimpleOperation.operation.AsyncRun(context, input)
164164
result |> SimpleOperation.validateResult (Some input)
165165
}
166166

167-
[<Fact>]
167+
[<Fact; Trait("Execution", "Sync")>]
168168
let ``Should be able to execute a query sending an input field with single and list fields``() =
169169
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
170170
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
171171
let input = Input(single, list)
172172
SimpleOperation.operation.Run(input)
173173
|> SimpleOperation.validateResult (Some input)
174174

175-
[<Fact>]
175+
[<Fact; Trait("Execution", "Sync")>]
176176
let ``Should be able to execute a query using context, sending an input field with single and list fields``() =
177177
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
178178
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
179179
let input = Input(single, list)
180180
SimpleOperation.operation.Run(context, input)
181181
|> SimpleOperation.validateResult (Some input)
182182

183-
[<Fact>]
183+
[<Fact; Trait("Execution", "Async")>]
184184
let ``Should be able to execute a query without sending an input field with single and list fields asynchronously``() : Task = task {
185185
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
186186
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
@@ -189,7 +189,7 @@ let ``Should be able to execute a query without sending an input field with sing
189189
result |> SimpleOperation.validateResult (Some input)
190190
}
191191

192-
[<Fact>]
192+
[<Fact; Trait("Execution", "Async")>]
193193
let ``Should be able to execute a query using context, sending an input field with single and list fields, asynchronously``() : Task = task {
194194
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
195195
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]

tests/FSharp.Data.GraphQL.IntegrationTests/LocalProviderWithOptionalParametersOnlyTests.fs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,131 +56,131 @@ module SimpleOperation =
5656
let output = result.Data.Value.Echo.Value.Single.Value |> map (fun x -> x.Int, x.IntOption, x.String, x.StringOption, x.Uri, x.Guid)
5757
input |> equals output))
5858

59-
[<Fact>]
59+
[<Fact; Trait("Execution", "Sync")>]
6060
let ``Should be able to execute a query without sending input field``() =
6161
SimpleOperation.operation.Run()
6262
|> SimpleOperation.validateResult None
6363

64-
[<Fact>]
64+
[<Fact; Trait("Execution", "Sync")>]
6565
let ``Should be able to execute a query using context, without sending input field``() =
6666
SimpleOperation.operation.Run(context)
6767
|> SimpleOperation.validateResult None
6868

69-
[<Fact>]
69+
[<Fact; Trait("Execution", "Async")>]
7070
let ``Should be able to execute a query without sending input field asynchronously``() =
7171
SimpleOperation.operation.AsyncRun()
7272
|> Async.RunSynchronously
7373
|> SimpleOperation.validateResult None
7474

75-
[<Fact>]
75+
[<Fact; Trait("Execution", "Async")>]
7676
let ``Should be able to execute a query using context, without sending input field, asynchronously``() : Task = task {
7777
let! result = SimpleOperation.operation.AsyncRun(context)
7878
result |> SimpleOperation.validateResult None
7979
}
8080

81-
[<Fact>]
81+
[<Fact; Trait("Execution", "Sync")>]
8282
let ``Should be able to execute a query sending an empty input field``() =
8383
let input = Input()
8484
SimpleOperation.operation.Run(Some input)
8585
|> SimpleOperation.validateResult (Some input)
8686

87-
[<Fact>]
87+
[<Fact; Trait("Execution", "Sync")>]
8888
let ``Should be able to execute a query using context, sending an empty input field``() =
8989
let input = Input()
9090
SimpleOperation.operation.Run(context, Some input)
9191
|> SimpleOperation.validateResult (Some input)
9292

93-
[<Fact>]
93+
[<Fact; Trait("Execution", "Async")>]
9494
let ``Should be able to execute a query without sending an empty input field asynchronously``() : Task = task {
9595
let input = Input()
9696
let! result = SimpleOperation.operation.AsyncRun(Some input)
9797
result |> SimpleOperation.validateResult (Some input)
9898
}
9999

100-
[<Fact>]
100+
[<Fact; Trait("Execution", "Async")>]
101101
let ``Should be able to execute a query using context, sending an empty input field, asynchronously``() : Task = task {
102102
let input = Input()
103103
let! result = SimpleOperation.operation.AsyncRun(context, Some input)
104104
result |> SimpleOperation.validateResult (Some input)
105105
}
106106

107-
[<Fact>]
107+
[<Fact; Trait("Execution", "Sync")>]
108108
let ``Should be able to execute a query sending an input field with single field``() =
109109
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
110110
let input = Input(Some single)
111111
SimpleOperation.operation.Run(Some input)
112112
|> SimpleOperation.validateResult (Some input)
113113

114-
[<Fact>]
114+
[<Fact; Trait("Execution", "Sync")>]
115115
let ``Should be able to execute a query using context, sending an input field with single field``() =
116116
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
117117
let input = Input(Some single)
118118
SimpleOperation.operation.Run(context, Some input)
119119
|> SimpleOperation.validateResult (Some input)
120120

121-
[<Fact>]
121+
[<Fact; Trait("Execution", "Async")>]
122122
let ``Should be able to execute a query without sending an input field with single field asynchronously``() : Task = task {
123123
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
124124
let input = Input(Some single)
125125
let! result = SimpleOperation.operation.AsyncRun(Some input)
126126
result |> SimpleOperation.validateResult (Some input)
127127
}
128128

129-
[<Fact>]
129+
[<Fact; Trait("Execution", "Async")>]
130130
let ``Should be able to execute a query using context, sending an input field with single field, asynchronously``() : Task = task {
131131
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
132132
let input = Input(Some single)
133133
let! result = SimpleOperation.operation.AsyncRun(context, Some input)
134134
result |> SimpleOperation.validateResult (Some input)
135135
}
136136

137-
[<Fact>]
137+
[<Fact; Trait("Execution", "Sync")>]
138138
let ``Should be able to execute a query sending an input field with list field``() =
139139
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
140140
let input = Input(list = Some list)
141141
SimpleOperation.operation.Run(Some input)
142142
|> SimpleOperation.validateResult (Some input)
143143

144-
[<Fact>]
144+
[<Fact; Trait("Execution", "Sync")>]
145145
let ``Should be able to execute a query using context, sending an input field with list field``() =
146146
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
147147
let input = Input(list = Some list)
148148
SimpleOperation.operation.Run(context, Some input)
149149
|> SimpleOperation.validateResult (Some input)
150150

151-
[<Fact>]
151+
[<Fact; Trait("Execution", "Async")>]
152152
let ``Should be able to execute a query without sending an input field with list field asynchronously``() : Task = task {
153153
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
154154
let input = Input(list = Some list)
155155
let! result = SimpleOperation.operation.AsyncRun(Some input)
156156
result |> SimpleOperation.validateResult (Some input)
157157
}
158158

159-
[<Fact>]
159+
[<Fact; Trait("Execution", "Async")>]
160160
let ``Should be able to execute a query using context, sending an input field with list field, asynchronously``() : Task = task {
161161
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
162162
let input = Input(list = Some list)
163163
let! result = SimpleOperation.operation.AsyncRun(context, Some input)
164164
result |> SimpleOperation.validateResult (Some input)
165165
}
166166

167-
[<Fact>]
167+
[<Fact; Trait("Execution", "Sync")>]
168168
let ``Should be able to execute a query sending an input field with single and list fields``() =
169169
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
170170
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
171171
let input = Input(Some single, Some list)
172172
SimpleOperation.operation.Run(Some input)
173173
|> SimpleOperation.validateResult (Some input)
174174

175-
[<Fact>]
175+
[<Fact; Trait("Execution", "Sync")>]
176176
let ``Should be able to execute a query using context, sending an input field with single and list fields``() =
177177
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
178178
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
179179
let input = Input(Some single, Some list)
180180
SimpleOperation.operation.Run(context, Some input)
181181
|> SimpleOperation.validateResult (Some input)
182182

183-
[<Fact>]
183+
[<Fact; Trait("Execution", "Async")>]
184184
let ``Should be able to execute a query without sending an input field with single and list fields asynchronously``() : Task = task {
185185
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
186186
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]
@@ -189,7 +189,7 @@ let ``Should be able to execute a query without sending an input field with sing
189189
result |> SimpleOperation.validateResult (Some input)
190190
}
191191

192-
[<Fact>]
192+
[<Fact; Trait("Execution", "Async")>]
193193
let ``Should be able to execute a query using context, sending an input field with single and list fields, asynchronously``() : Task = task {
194194
let single = InputField("A", 2, System.Uri("http://localhost:1234"), EmptyGuidAsString)
195195
let list = [|InputField("A", 2, System.Uri("http://localhost:4321"), EmptyGuidAsString)|]

tests/FSharp.Data.GraphQL.IntegrationTests/SwapiLocalProviderTests.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@ hero (id: "1000") {
8686
Name = Some "Luke Skywalker";};}"""
8787
actual |> equals expected
8888

89-
[<Fact>]
89+
[<Fact; Trait("Execution", "Sync")>]
9090
let ``Should be able to start a simple query operation synchronously`` () =
9191
use context = getContext()
9292
SimpleOperation.operation.Run(context)
9393
|> SimpleOperation.validateResult
9494

95-
[<Fact>]
95+
[<Fact; Trait("Execution", "Async")>]
9696
let ``Should be able to start a simple query operation asynchronously`` () : Task = task {
9797
use context = getContext()
9898
let! result = SimpleOperation.operation.AsyncRun(context)
9999
result |> SimpleOperation.validateResult
100100
}
101101

102-
[<Fact>]
102+
[<Fact; Trait("Execution", "Sync")>]
103103
let ``Should be able to use pattern matching methods on an union type`` () =
104104
use context = getContext()
105105
let result = SimpleOperation.operation.Run(context)
@@ -158,13 +158,13 @@ module MutationOperation =
158158
result.Data.Value.SetMoon.Value.Name |> equals (Some "Tatooine")
159159
result.Data.Value.SetMoon.Value.IsMoon |> equals (Some true)
160160

161-
[<Fact>]
161+
[<Fact; Trait("Execution", "Sync")>]
162162
let ``Should be able to run a mutation synchronously`` () =
163163
use context = getContext()
164164
MutationOperation.operation.Run(context)
165165
|> MutationOperation.validateResult
166166

167-
[<Fact>]
167+
[<Fact; Trait("Execution", "Async")>]
168168
let ``Should be able to run a mutation asynchronously`` () : Task = task {
169169
use context = getContext()
170170
let! result = MutationOperation.operation.AsyncRun(context)
@@ -212,7 +212,7 @@ module FileOperation =
212212
Name = Some "Luke Skywalker";};}"""
213213
actual |> equals expected
214214

215-
[<Fact>]
215+
[<Fact; Trait("Execution", "Sync")>]
216216
let ``Should be able to run a query from a query file`` () =
217217
use context = getContext()
218218
FileOperation.fileop.Run(context)

0 commit comments

Comments
 (0)