1
- /* Copyright 2020 -present MongoDB Inc.
1
+ /* Copyright 2021 -present MongoDB Inc.
2
2
*
3
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
4
* you may not use this file except in compliance with the License.
25
25
using MongoDB . Driver . Core . Misc ;
26
26
using MongoDB . Driver . Core . TestHelpers ;
27
27
using MongoDB . Driver . Core . TestHelpers . XunitExtensions ;
28
- using MongoDB . Driver . Tests . UnifiedTestOperations ;
28
+ using MongoDB . Driver . Tests . UnifiedTestOperations . Matchers ;
29
29
using Xunit ;
30
30
31
- namespace MongoDB . Driver . Tests . Specifications . unified_test_format
31
+ namespace MongoDB . Driver . Tests . UnifiedTestOperations
32
32
{
33
- public sealed class UnifiedTestFormatTestRunner : IDisposable
33
+ public sealed class UnifiedTestRunner : IDisposable
34
34
{
35
35
private readonly bool _allowKillSessions ;
36
36
private UnifiedEntityMap _entityMap ;
@@ -39,7 +39,7 @@ public sealed class UnifiedTestFormatTestRunner : IDisposable
39
39
private readonly Dictionary < string , IEventFormatter > _eventFormatters ;
40
40
private bool _runHasBeenCalled ;
41
41
42
- public UnifiedTestFormatTestRunner (
42
+ public UnifiedTestRunner (
43
43
bool allowKillSessions = true , // TODO: should be removed after SERVER-54216
44
44
Dictionary < string , object > additionalArgs = null ,
45
45
Dictionary < string , IEventFormatter > eventFormatters = null )
@@ -52,8 +52,6 @@ public UnifiedTestFormatTestRunner(
52
52
// public properties
53
53
public UnifiedEntityMap EntityMap => _entityMap ;
54
54
55
- [ SkippableTheory ]
56
- [ ClassData ( typeof ( TestCaseFactory ) ) ]
57
55
public void Run ( JsonDrivenTestCase testCase )
58
56
{
59
57
// Top-level fields
@@ -324,34 +322,5 @@ private void KillOpenTransactions(IMongoClient client)
324
322
}
325
323
}
326
324
}
327
-
328
- // nested types
329
- public class TestCaseFactory : JsonDrivenTestCaseFactory
330
- {
331
- #region static
332
- private static readonly string [ ] __ignoredTestNames =
333
- {
334
- "poc-retryable-writes.json:InsertOne fails after multiple retryable writeConcernErrors" // CSHARP-3269
335
- } ;
336
- #endregion
337
-
338
- // protected properties
339
- protected override string PathPrefix => "MongoDB.Driver.Tests.Specifications.unified_test_format.tests.valid_pass." ;
340
-
341
- // protected methods
342
- protected override IEnumerable < JsonDrivenTestCase > CreateTestCases ( BsonDocument document )
343
- {
344
- var testCases = base . CreateTestCases ( document ) . Where ( test => ! __ignoredTestNames . Any ( ignoredName => test . Name . EndsWith ( ignoredName ) ) ) ;
345
- foreach ( var testCase in testCases )
346
- {
347
- foreach ( var async in new [ ] { false , true } )
348
- {
349
- var name = $ "{ testCase . Name . Replace ( PathPrefix , "" ) } :async={ async} ";
350
- var test = testCase . Test . DeepClone ( ) . AsBsonDocument . Add ( "async" , async ) ;
351
- yield return new JsonDrivenTestCase( name , testCase . Shared , test ) ;
352
- }
353
- }
354
- }
355
- }
356
325
}
357
326
}
0 commit comments