Skip to content

Commit 8e0c3ed

Browse files
Adopt special-words scenarios (Azure#49803)
1 parent c03d67c commit 8e0c3ed

File tree

3 files changed

+850
-0
lines changed

3 files changed

+850
-0
lines changed
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Threading.Tasks;
5+
using SpecialWords;
6+
using SpecialWords._ModelProperties;
7+
using SpecialWords._Models;
8+
using SpecialWordsAssert = SpecialWords._Models.Assert;
9+
using SpecialWordsIs = SpecialWords._Models.Is;
10+
11+
namespace TestProjects.Spector.Tests.Http.SpecialWords
12+
{
13+
public partial class SpecialWordsTests : SpectorTestBase
14+
{
15+
[SpectorTest]
16+
public Task ModelsWithAndAsync() => Test(async (host) =>
17+
{
18+
var client = new SpecialWordsClient(host, null).GetModelsClient();
19+
var response = await client.WithAndAsync(new And("ok"));
20+
NUnit.Framework.Assert.AreEqual(204, response.Status);
21+
});
22+
23+
[SpectorTest]
24+
public Task ModelsWithAsAsync() => Test(async (host) =>
25+
{
26+
var client = new SpecialWordsClient(host, null).GetModelsClient();
27+
var response = await client.WithAsAsync(new As("ok"));
28+
NUnit.Framework.Assert.AreEqual(204, response.Status);
29+
});
30+
31+
[SpectorTest]
32+
public Task ModelsWithAssertAsync() => Test(async (host) =>
33+
{
34+
var client = new SpecialWordsClient(host, null).GetModelsClient();
35+
var response = await client.WithAssertAsync(new SpecialWordsAssert("ok"));
36+
NUnit.Framework.Assert.AreEqual(204, response.Status);
37+
});
38+
39+
[SpectorTest]
40+
public Task ModelsWithAsyncAsync() => Test(async (host) =>
41+
{
42+
var client = new SpecialWordsClient(host, null).GetModelsClient();
43+
var response = await client.WithAsyncAsync(new Async("ok"));
44+
NUnit.Framework.Assert.AreEqual(204, response.Status);
45+
});
46+
47+
[SpectorTest]
48+
public Task ModelsWithAwaitAsync() => Test(async (host) =>
49+
{
50+
var client = new SpecialWordsClient(host, null).GetModelsClient();
51+
var response = await client.WithAwaitAsync(new Await("ok"));
52+
NUnit.Framework.Assert.AreEqual(204, response.Status);
53+
});
54+
55+
[SpectorTest]
56+
public Task ModelsWithBreakAsync() => Test(async (host) =>
57+
{
58+
var client = new SpecialWordsClient(host, null).GetModelsClient();
59+
var response = await client.WithBreakAsync(new Break("ok"));
60+
NUnit.Framework.Assert.AreEqual(204, response.Status);
61+
});
62+
63+
[SpectorTest]
64+
public Task ModelsWithClassAsync() => Test(async (host) =>
65+
{
66+
var client = new SpecialWordsClient(host, null).GetModelsClient();
67+
var response = await client.WithClassAsync(new Class("ok"));
68+
NUnit.Framework.Assert.AreEqual(204, response.Status);
69+
});
70+
71+
[SpectorTest]
72+
public Task ModelsWithConstructorAsync() => Test(async (host) =>
73+
{
74+
var client = new SpecialWordsClient(host, null).GetModelsClient();
75+
var response = await client.WithConstructorAsync(new Constructor("ok"));
76+
NUnit.Framework.Assert.AreEqual(204, response.Status);
77+
});
78+
79+
[SpectorTest]
80+
public Task ModelsWithContinueAsync() => Test(async (host) =>
81+
{
82+
var client = new SpecialWordsClient(host, null).GetModelsClient();
83+
var response = await client.WithContinueAsync(new Continue("ok"));
84+
NUnit.Framework.Assert.AreEqual(204, response.Status);
85+
});
86+
87+
[SpectorTest]
88+
public Task ModelsWithDefAsync() => Test(async (host) =>
89+
{
90+
var client = new SpecialWordsClient(host, null).GetModelsClient();
91+
var response = await client.WithDefAsync(new Def("ok"));
92+
NUnit.Framework.Assert.AreEqual(204, response.Status);
93+
});
94+
95+
[SpectorTest]
96+
public Task ModelsWithDelAsync() => Test(async (host) =>
97+
{
98+
var client = new SpecialWordsClient(host, null).GetModelsClient();
99+
var response = await client.WithDelAsync(new Del("ok"));
100+
NUnit.Framework.Assert.AreEqual(204, response.Status);
101+
});
102+
103+
[SpectorTest]
104+
public Task ModelsWithElifAsync() => Test(async (host) =>
105+
{
106+
var client = new SpecialWordsClient(host, null).GetModelsClient();
107+
var response = await client.WithElifAsync(new Elif("ok"));
108+
NUnit.Framework.Assert.AreEqual(204, response.Status);
109+
});
110+
111+
[SpectorTest]
112+
public Task ModelsWithElseAsync() => Test(async (host) =>
113+
{
114+
var client = new SpecialWordsClient(host, null).GetModelsClient();
115+
var response = await client.WithElseAsync(new Else("ok"));
116+
NUnit.Framework.Assert.AreEqual(204, response.Status);
117+
});
118+
119+
[SpectorTest]
120+
public Task ModelsWithExceptAsync() => Test(async (host) =>
121+
{
122+
var client = new SpecialWordsClient(host, null).GetModelsClient();
123+
var response = await client.WithExceptAsync(new Except("ok"));
124+
NUnit.Framework.Assert.AreEqual(204, response.Status);
125+
});
126+
127+
[SpectorTest]
128+
public Task ModelsWithExecAsync() => Test(async (host) =>
129+
{
130+
var client = new SpecialWordsClient(host, null).GetModelsClient();
131+
var response = await client.WithExecAsync(new Exec("ok"));
132+
NUnit.Framework.Assert.AreEqual(204, response.Status);
133+
});
134+
135+
[SpectorTest]
136+
public Task ModelsWithFinallyAsync() => Test(async (host) =>
137+
{
138+
var client = new SpecialWordsClient(host, null).GetModelsClient();
139+
var response = await client.WithFinallyAsync(new Finally("ok"));
140+
NUnit.Framework.Assert.AreEqual(204, response.Status);
141+
});
142+
143+
[SpectorTest]
144+
public Task ModelsWithFromAsync() => Test(async (host) =>
145+
{
146+
var client = new SpecialWordsClient(host, null).GetModelsClient();
147+
var response = await client.WithFromAsync(new From("ok"));
148+
NUnit.Framework.Assert.AreEqual(204, response.Status);
149+
});
150+
151+
[SpectorTest]
152+
public Task ModelsWithGlobalAsync() => Test(async (host) =>
153+
{
154+
var client = new SpecialWordsClient(host, null).GetModelsClient();
155+
var response = await client.WithGlobalAsync(new Global("ok"));
156+
NUnit.Framework.Assert.AreEqual(204, response.Status);
157+
});
158+
159+
[SpectorTest]
160+
public Task ModelsWithImportAsync() => Test(async (host) =>
161+
{
162+
var client = new SpecialWordsClient(host, null).GetModelsClient();
163+
var response = await client.WithImportAsync(new Import("ok"));
164+
NUnit.Framework.Assert.AreEqual(204, response.Status);
165+
});
166+
167+
[SpectorTest]
168+
public Task ModelsWithInAsync() => Test(async (host) =>
169+
{
170+
var client = new SpecialWordsClient(host, null).GetModelsClient();
171+
var response = await client.WithInAsync(new In("ok"));
172+
NUnit.Framework.Assert.AreEqual(204, response.Status);
173+
});
174+
175+
[SpectorTest]
176+
public Task ModelsWithIsAsync() => Test(async (host) =>
177+
{
178+
var client = new SpecialWordsClient(host, null).GetModelsClient();
179+
var response = await client.WithIsAsync(new SpecialWordsIs("ok"));
180+
NUnit.Framework.Assert.AreEqual(204, response.Status);
181+
});
182+
183+
[SpectorTest]
184+
public Task ModelsWithLambdaAsync() => Test(async (host) =>
185+
{
186+
var client = new SpecialWordsClient(host, null).GetModelsClient();
187+
var response = await client.WithLambdaAsync(new Lambda("ok"));
188+
NUnit.Framework.Assert.AreEqual(204, response.Status);
189+
});
190+
191+
[SpectorTest]
192+
public Task ModelsWithNotAsync() => Test(async (host) =>
193+
{
194+
var client = new SpecialWordsClient(host, null).GetModelsClient();
195+
var response = await client.WithNotAsync(new Not("ok"));
196+
NUnit.Framework.Assert.AreEqual(204, response.Status);
197+
});
198+
199+
200+
[SpectorTest]
201+
public Task ModelsWithOrAsync() => Test(async (host) =>
202+
{
203+
var client = new SpecialWordsClient(host, null).GetModelsClient();
204+
var response = await client.WithOrAsync(new Or("ok"));
205+
NUnit.Framework.Assert.AreEqual(204, response.Status);
206+
});
207+
208+
[SpectorTest]
209+
public Task ModelsWithPassAsync() => Test(async (host) =>
210+
{
211+
var client = new SpecialWordsClient(host, null).GetModelsClient();
212+
var response = await client.WithPassAsync(new Pass("ok"));
213+
NUnit.Framework.Assert.AreEqual(204, response.Status);
214+
});
215+
216+
[SpectorTest]
217+
public Task ModelsWithRaiseAsync() => Test(async (host) =>
218+
{
219+
var client = new SpecialWordsClient(host, null).GetModelsClient();
220+
var response = await client.WithRaiseAsync(new Raise("ok"));
221+
NUnit.Framework.Assert.AreEqual(204, response.Status);
222+
});
223+
224+
[SpectorTest]
225+
public Task ModelsWithReturnAsync() => Test(async (host) =>
226+
{
227+
var client = new SpecialWordsClient(host, null).GetModelsClient();
228+
var response = await client.WithReturnAsync(new Return("ok"));
229+
NUnit.Framework.Assert.AreEqual(204, response.Status);
230+
});
231+
232+
[SpectorTest]
233+
public Task ModelsWithTryAsync() => Test(async (host) =>
234+
{
235+
var client = new SpecialWordsClient(host, null).GetModelsClient();
236+
var response = await client.WithTryAsync(new Try("ok"));
237+
NUnit.Framework.Assert.AreEqual(204, response.Status);
238+
});
239+
240+
[SpectorTest]
241+
public Task ModelsWithIfAsync() => Test(async (host) =>
242+
{
243+
var client = new SpecialWordsClient(host, null).GetModelsClient();
244+
var response = await client.WithIfAsync(new If("ok"));
245+
NUnit.Framework.Assert.AreEqual(204, response.Status);
246+
});
247+
248+
[SpectorTest]
249+
public Task ModelsWithForAsync() => Test(async (host) =>
250+
{
251+
var client = new SpecialWordsClient(host, null).GetModelsClient();
252+
var response = await client.WithForAsync(new For("ok"));
253+
NUnit.Framework.Assert.AreEqual(204, response.Status);
254+
});
255+
256+
[SpectorTest]
257+
public Task ModelsWithWithAsync() => Test(async (host) =>
258+
{
259+
var client = new SpecialWordsClient(host, null).GetModelsClient();
260+
var response = await client.WithWithAsync(new With("ok"));
261+
NUnit.Framework.Assert.AreEqual(204, response.Status);
262+
});
263+
264+
[SpectorTest]
265+
public Task ModelsWithWhileAsync() => Test(async (host) =>
266+
{
267+
var client = new SpecialWordsClient(host, null).GetModelsClient();
268+
var response = await client.WithWhileAsync(new While("ok"));
269+
NUnit.Framework.Assert.AreEqual(204, response.Status);
270+
});
271+
272+
[SpectorTest]
273+
public Task ModelsWithYieldAsync() => Test(async (host) =>
274+
{
275+
var client = new SpecialWordsClient(host, null).GetModelsClient();
276+
var response = await client.WithYieldAsync(new Yield("ok"));
277+
NUnit.Framework.Assert.AreEqual(204, response.Status);
278+
});
279+
280+
[SpectorTest]
281+
public Task ModelProperties_SameAsModelAsync() => Test(async (host) =>
282+
{
283+
SameAsModel body = new SameAsModel("ok");
284+
var client = new SpecialWordsClient(host, null).GetModelPropertiesClient();
285+
var response = await client.SameAsModelAsync(body);
286+
NUnit.Framework.Assert.AreEqual(204, response.Status);
287+
});
288+
}
289+
}

0 commit comments

Comments
 (0)