7
7
using MbDotNet . Models . Predicates . Fields ;
8
8
using MbDotNet . Models . Responses ;
9
9
using MbDotNet . Models . Responses . Fields ;
10
- using Microsoft . VisualStudio . TestTools . UnitTesting ;
10
+
11
+ using Xunit ;
11
12
12
13
namespace MbDotNet . Tests . Acceptance
13
14
{
@@ -17,20 +18,24 @@ namespace MbDotNet.Tests.Acceptance
17
18
/// See the comment above each individual test to figure out which
18
19
/// example it is describing.
19
20
/// </summary>
20
- [ TestClass , TestCategory ( "Acceptance" ) ]
21
+ [ Trait ( "Category" , "Acceptance" ) ]
22
+ [ Collection ( "Sequential" ) ]
21
23
public class DocumentationTests : AcceptanceTestBase
22
24
{
23
- [ TestInitialize ]
24
- public async Task TestInitialize ( )
25
+ /// <summary>
26
+ /// It act as test initialize in x unit
27
+ /// at https://xunit.net/docs/comparisons
28
+ /// </summary>
29
+ public DocumentationTests ( )
25
30
{
26
- await _client . DeleteAllImpostersAsync ( ) ;
31
+ _client . DeleteAllImpostersAsync ( ) . ConfigureAwait ( false ) ;
27
32
}
28
33
29
34
/// <summary>
30
35
/// This test shows how to setup the imposter in the stub example
31
36
/// at http://www.mbtest.org/docs/api/stubs.
32
37
/// </summary>
33
- [ TestMethod ]
38
+ [ Fact ]
34
39
public async Task StubExample ( )
35
40
{
36
41
await _client . CreateHttpImposterAsync ( 4545 , "StubExample" , imposter =>
@@ -45,7 +50,7 @@ await _client.CreateHttpImposterAsync(4545, "StubExample", imposter =>
45
50
/// This test shows how to setup the imposter with a dynamic port chosen by Mountebank
46
51
/// See imposter resource at http://www.mbtest.org/docs/api/contracts for more information.
47
52
/// </summary>
48
- [ TestMethod ]
53
+ [ Fact ]
49
54
public async Task DynamicPortExample ( )
50
55
{
51
56
await _client . CreateHttpImposterAsync ( null , "DynamicPort" , _ => { } ) ;
@@ -55,7 +60,7 @@ public async Task DynamicPortExample()
55
60
/// This test shows how to setup the imposter in the equals predicate example
56
61
/// at http://www.mbtest.org/docs/api/predicates.
57
62
/// </summary>
58
- [ TestMethod ]
63
+ [ Fact ]
59
64
public async Task EqualsPredicateExample ( )
60
65
{
61
66
await _client . CreateHttpImposterAsync ( 4545 , "EqualsPredicateExample" , imposter =>
@@ -77,7 +82,8 @@ await _client.CreateHttpImposterAsync(4545, "EqualsPredicateExample", imposter =
77
82
78
83
var complexPredicate = new EqualsPredicate < HttpPredicateFields > ( complexPredicateFields ) ;
79
84
80
- imposter . AddStub ( ) . On ( complexPredicate ) . On ( bodyPredicate ) . ReturnsStatus ( HttpStatusCode . BadRequest ) ;
85
+ imposter . AddStub ( )
86
+ . On ( complexPredicate ) . On ( bodyPredicate ) . ReturnsStatus ( HttpStatusCode . BadRequest ) ;
81
87
82
88
// Second stub
83
89
var fields = new HttpPredicateFields
@@ -99,7 +105,7 @@ await _client.CreateHttpImposterAsync(4545, "EqualsPredicateExample", imposter =
99
105
/// This test shows how to setup the imposter in the deepEquals predicate example
100
106
/// at http://www.mbtest.org/docs/api/predicates.
101
107
/// </summary>
102
- [ TestMethod ]
108
+ [ Fact ]
103
109
public async Task DeepEqualsPredicateExample ( )
104
110
{
105
111
await _client . CreateHttpImposterAsync ( 4556 , "DeepEqualsPredicateExample" , imposter =>
@@ -152,7 +158,7 @@ await _client.CreateHttpImposterAsync(4556, "DeepEqualsPredicateExample", impost
152
158
/// This test shows how to setup the imposter in the contains predicate example
153
159
/// at http://www.mbtest.org/docs/api/predicates.
154
160
/// </summary>
155
- [ TestMethod ]
161
+ [ Fact ]
156
162
public async Task ContainsPredicateExample ( )
157
163
{
158
164
await _client . CreateTcpImposterAsync ( 4547 , "ContainsPredicateExample" , imposter =>
@@ -192,7 +198,7 @@ await _client.CreateTcpImposterAsync(4547, "ContainsPredicateExample", imposter
192
198
/// This test shows how to setup the imposter in the startsWith predicate example
193
199
/// at http://www.mbtest.org/docs/api/predicates.
194
200
/// </summary>
195
- [ TestMethod ]
201
+ [ Fact ]
196
202
public async Task StartsWithPredicateExample ( )
197
203
{
198
204
await _client . CreateTcpImposterAsync ( 4548 , "StartsWithPredicateExample" , imposter =>
@@ -230,7 +236,7 @@ await _client.CreateTcpImposterAsync(4548, "StartsWithPredicateExample", imposte
230
236
/// This test shows how to setup the imposter in the endsWith predicate example
231
237
/// at http://www.mbtest.org/docs/api/predicates.
232
238
/// </summary>
233
- [ TestMethod ]
239
+ [ Fact ]
234
240
public async Task EndsWithPredicateExample ( )
235
241
{
236
242
await _client . CreateTcpImposterAsync ( 4549 , "EndsWithPredicateExample" , imposter =>
@@ -270,7 +276,7 @@ await _client.CreateTcpImposterAsync(4549, "EndsWithPredicateExample", imposter
270
276
/// This test shows how to setup the imposter in the matches predicate example
271
277
/// at http://www.mbtest.org/docs/api/predicates.
272
278
/// </summary>
273
- [ TestMethod ]
279
+ [ Fact ]
274
280
public async Task MatchesPredicateExample ( )
275
281
{
276
282
await _client . CreateTcpImposterAsync ( 4550 , "MatchesPredicateExample" , imposter =>
@@ -308,7 +314,7 @@ await _client.CreateTcpImposterAsync(4550, "MatchesPredicateExample", imposter =
308
314
/// This test shows how to setup the imposter in the exists predicate example
309
315
/// at http://www.mbtest.org/docs/api/predicates.
310
316
/// </summary>
311
- [ TestMethod ]
317
+ [ Fact ]
312
318
public async Task ExistsPredicateExample ( )
313
319
{
314
320
await _client . CreateHttpImposterAsync ( 4550 , "ExistsPredicateExample" , imposter =>
@@ -343,7 +349,7 @@ await _client.CreateHttpImposterAsync(4550, "ExistsPredicateExample", imposter =
343
349
/// This test shows how to setup the imposter in the not predicate example
344
350
/// at http://www.mbtest.org/docs/api/predicates.
345
351
/// </summary>
346
- [ TestMethod ]
352
+ [ Fact ]
347
353
public async Task NotPredicateExample ( )
348
354
{
349
355
await _client . CreateTcpImposterAsync ( 4552 , "NotPredicateExample" , imposter =>
@@ -364,7 +370,7 @@ await _client.CreateTcpImposterAsync(4552, "NotPredicateExample", imposter =>
364
370
/// This test shows how to setup the imposter in the or predicate example
365
371
/// at http://www.mbtest.org/docs/api/predicates.
366
372
/// </summary>
367
- [ TestMethod ]
373
+ [ Fact ]
368
374
public async Task OrPredicateExample ( )
369
375
{
370
376
await _client . CreateTcpImposterAsync ( 4553 , "OrPredicateExample" , imposter =>
@@ -389,7 +395,7 @@ await _client.CreateTcpImposterAsync(4553, "OrPredicateExample", imposter =>
389
395
/// This test shows how to setup the imposter in the and predicate example
390
396
/// at http://www.mbtest.org/docs/api/predicates.
391
397
/// </summary>
392
- [ TestMethod ]
398
+ [ Fact ]
393
399
public async Task AndPredicateExample ( )
394
400
{
395
401
await _client . CreateTcpImposterAsync ( 4554 , "AndPredicateExample" , imposter =>
@@ -414,7 +420,7 @@ await _client.CreateTcpImposterAsync(4554, "AndPredicateExample", imposter =>
414
420
/// This test shows how to setup the imposter in the json example
415
421
/// at http://localhost:2525/docs/api/json.
416
422
/// </summary>
417
- [ TestMethod ]
423
+ [ Fact ]
418
424
public async Task JsonExample ( )
419
425
{
420
426
await _client . CreateHttpImposterAsync ( 4545 , "JsonExample" , imposter =>
@@ -442,7 +448,7 @@ await _client.CreateHttpImposterAsync(4545, "JsonExample", imposter =>
442
448
/// This test shows how to setup the imposter in the stub with wait behavior
443
449
/// at https://www.mbtest.org/docs/api/behaviors#behavior-wait
444
450
/// </summary>
445
- [ TestMethod ]
451
+ [ Fact ]
446
452
public async Task WaitBehaviorExample ( )
447
453
{
448
454
await _client . CreateHttpImposterAsync ( 4546 , "WaitBehaviorExample" , imposter =>
@@ -456,7 +462,7 @@ await _client.CreateHttpImposterAsync(4546, "WaitBehaviorExample", imposter =>
456
462
/// This test shows how to setup the imposter in the inject predicate example
457
463
/// at http://www.mbtest.org/docs/api/injection.
458
464
/// </summary>
459
- [ TestMethod ]
465
+ [ Fact ]
460
466
public async Task HttpInjectPredicateExample ( )
461
467
{
462
468
await _client . CreateHttpImposterAsync ( 4547 , "HttpInjectPredicateExample" , imposter =>
@@ -471,7 +477,7 @@ await _client.CreateHttpImposterAsync(4547, "HttpInjectPredicateExample", impost
471
477
/// This test shows how to setup the imposter in the connection reset fault response example
472
478
/// at http://www.mbtest.org/docs/api/faults#connection-reset.
473
479
/// </summary>
474
- [ TestMethod ]
480
+ [ Fact ]
475
481
public async Task ConnectionResetFaultResponseExample ( )
476
482
{
477
483
await _client . CreateTcpImposterAsync ( 4554 , imposter =>
@@ -485,7 +491,7 @@ await _client.CreateTcpImposterAsync(4554, imposter =>
485
491
/// This test shows how to setup the imposter in the random data fault response example
486
492
/// at http://www.mbtest.org/docs/api/faults#random-data-then-close.
487
493
/// </summary>
488
- [ TestMethod ]
494
+ [ Fact ]
489
495
public async Task RandomDataFaultResponseExample ( )
490
496
{
491
497
await _client . CreateTcpImposterAsync ( 4554 , imposter =>
0 commit comments