Skip to content

Commit 9866f18

Browse files
committed
CSHARP-4421: Unify all spec tests in single test project
1 parent e201525 commit 9866f18

23 files changed

+45
-80
lines changed

tests/MongoDB.Bson.Tests/MongoDB.Bson.Tests.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@
7272
<ProjectReference Include="..\MongoDB.Bson.TestHelpers\MongoDB.Bson.TestHelpers.csproj" />
7373
</ItemGroup>
7474

75-
<ItemGroup>
76-
<EmbeddedResource LinkBase="Specifications\bson-corpus" Include="..\..\specifications\bson-corpus\**\*.json" />
77-
<EmbeddedResource LinkBase="Specifications\bson-decimal128" Include="..\..\specifications\bson-decimal128\**\*.json" />
78-
<EmbeddedResource LinkBase="Specifications\uuid" Include="..\..\specifications\uuid\**\*.json" />
79-
</ItemGroup>
80-
8175
<ItemGroup>
8276
<None Update="xunit.runner.json">
8377
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

tests/MongoDB.Driver.Core.Tests/Core/Helpers/MockClusterableServerFactory.cs renamed to tests/MongoDB.Driver.Core.TestHelpers/MockClusterableServerFactory.cs

File renamed without changes.

tests/MongoDB.Driver.Core.Tests/Core/Helpers/MockConnection.cs renamed to tests/MongoDB.Driver.Core.TestHelpers/MockConnection.cs

File renamed without changes.

tests/MongoDB.Driver.Core.TestHelpers/MongoDB.Driver.Core.TestHelpers.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<ItemGroup>
5353
<PackageReference Include="FluentAssertions" Version="4.12.0" />
5454
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" />
55+
<PackageReference Include="Moq" Version="4.9.0" />
5556
<PackageReference Include="xunit" Version="2.4.0" />
5657
<PackageReference Include="JunitXml.TestLogger" Version="2.1.81" />
5758
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />

tests/MongoDB.Driver.Core.Tests/Core/Servers/LoadBalancedServerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
using MongoDB.Driver.Core.Logging;
3333
using MongoDB.Driver.Core.TestHelpers;
3434
using MongoDB.Driver.Core.TestHelpers.Logging;
35-
using MongoDB.Driver.Specifications.connection_monitoring_and_pooling;
3635
using Moq;
3736
using Xunit;
3837
using Xunit.Abstractions;

tests/MongoDB.Driver.Core.Tests/MongoDB.Driver.Core.Tests.csproj

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
<PackageReference Include="FluentAssertions" Version="4.12.0" />
5555
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" />
5656
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
57-
<PackageReference Include="Moq" Version="4.9.0" />
5857
<PackageReference Include="xunit" Version="2.4.0" />
5958
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
6059
<PackageReference Include="JunitXml.TestLogger" Version="2.1.81" />
@@ -67,17 +66,6 @@
6766
<ProjectReference Include="..\MongoDB.Driver.Core.TestHelpers\MongoDB.Driver.Core.TestHelpers.csproj" />
6867
</ItemGroup>
6968

70-
<ItemGroup>
71-
<EmbeddedResource LinkBase="Specifications\connection-monitoring-and-pooling\tests\cmap-format" Include="..\..\specifications\connection-monitoring-and-pooling\tests\cmap-format\*.json" />
72-
<EmbeddedResource LinkBase="Specifications\connection-string" Include="..\..\specifications\connection-string\**\*.json" />
73-
<EmbeddedResource LinkBase="Specifications\initial-dns-seedlist-discovery" Include="..\..\specifications\initial-dns-seedlist-discovery\**\*.json" />
74-
<EmbeddedResource LinkBase="Specifications\max-staleness" Include="..\..\specifications\max-staleness\**\*.json" />
75-
<EmbeddedResource LinkBase="Specifications\read-write-concern" Include="..\..\specifications\read-write-concern\**\*.json" />
76-
<EmbeddedResource LinkBase="Specifications\server-discovery-and-monitoring" Include="..\..\specifications\server-discovery-and-monitoring\**\*.json" />
77-
<EmbeddedResource LinkBase="Specifications\server-selection" Include="..\..\specifications\server-selection\**\*.json" />
78-
<EmbeddedResource LinkBase="Specifications\uri-options" Include="..\..\specifications\uri-options\**\*.json" />
79-
</ItemGroup>
80-
8169
<ItemGroup>
8270
<None Update="xunit.runner.json">
8371
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

tests/MongoDB.Driver.Tests/MongoDB.Driver.Tests.csproj

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,7 @@
7171
</ItemGroup>
7272

7373
<ItemGroup>
74-
<EmbeddedResource LinkBase="Specifications\atlas-data-lake-testing" Include="..\..\specifications\atlas-data-lake-testing\**\*.json" />
75-
<EmbeddedResource LinkBase="Specifications\auth" Include="..\..\specifications\auth\**\*.json" />
76-
<EmbeddedResource LinkBase="Specifications\change-streams" Include="..\..\specifications\change-streams\**\*.json" />
77-
<EmbeddedResource LinkBase="Specifications\client-side-encryption" Include="..\..\specifications\client-side-encryption\**\*.json" />
78-
<EmbeddedResource LinkBase="Specifications\collection-management" Include="..\..\specifications\collection-management\**\*.json" />
79-
<EmbeddedResource LinkBase="Specifications\command-logging-and-monitoring" Include="..\..\specifications\command-logging-and-monitoring\**\*.json" />
80-
<EmbeddedResource LinkBase="Specifications\connection-monitoring-and-pooling\tests\logging" Include="..\..\specifications\connection-monitoring-and-pooling\tests\logging\*.json" />
81-
<EmbeddedResource LinkBase="Specifications\crud" Include="..\..\specifications\crud\**\*.json" />
82-
<EmbeddedResource LinkBase="Specifications\load-balancers" Include="..\..\specifications\load-balancers\**\*.json" />
83-
<EmbeddedResource LinkBase="Specifications\read-write-concern" Include="..\..\specifications\read-write-concern\**\*.json" />
84-
<EmbeddedResource LinkBase="Specifications\retryable-reads" Include="..\..\specifications\retryable-reads\**\*.json" />
85-
<EmbeddedResource LinkBase="Specifications\retryable-writes" Include="..\..\specifications\retryable-writes\**\*.json" />
86-
<EmbeddedResource LinkBase="Specifications\server-discovery-and-monitoring" Include="..\..\specifications\server-discovery-and-monitoring\**\*.json" />
87-
<EmbeddedResource LinkBase="Specifications\sessions" Include="..\..\specifications\sessions\**\*.json" />
88-
<EmbeddedResource LinkBase="Specifications\transactions" Include="..\..\specifications\transactions\**\*.json" />
89-
<EmbeddedResource LinkBase="Specifications\transactions-convenient-api" Include="..\..\specifications\transactions-convenient-api\**\*.json" />
90-
<EmbeddedResource LinkBase="Specifications\unified-test-format" Include="..\..\specifications\unified-test-format\**\*.json" />
91-
<EmbeddedResource LinkBase="Specifications\versioned-api" Include="..\..\specifications\versioned-api\**\*.json" />
74+
<EmbeddedResource LinkBase="Specifications\" Include="..\..\specifications\**\*.json" />
9275
</ItemGroup>
9376

9477
<ItemGroup>

tests/MongoDB.Bson.Tests/Specifications/bson-corpus/BsonCorpusTestRunner.cs renamed to tests/MongoDB.Driver.Tests/Specifications/bson-corpus/BsonCorpusTestRunner.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
using System.Linq;
2020
using System.Text.RegularExpressions;
2121
using FluentAssertions;
22+
using MongoDB.Bson;
2223
using MongoDB.Bson.IO;
2324
using MongoDB.Bson.Serialization;
2425
using MongoDB.Bson.Serialization.Serializers;
2526
using MongoDB.Bson.TestHelpers.JsonDrivenTests;
2627
using Xunit;
2728

28-
namespace MongoDB.Bson.Tests.Specifications.bson_corpus
29+
namespace MongoDB.Driver.Tests.Specifications.bson_corpus
2930
{
3031
public class BsonCorpusTestRunner
3132
{
@@ -300,7 +301,7 @@ private class TestCaseFactory : JsonDrivenTestCaseFactory
300301
#endregion
301302

302303
// protected properties
303-
protected override string PathPrefix => "MongoDB.Bson.Tests.Specifications.bson_corpus.tests.";
304+
protected override string PathPrefix => "MongoDB.Driver.Tests.Specifications.bson_corpus.tests.";
304305

305306
// protected methods
306307
protected override IEnumerable<JsonDrivenTestCase> CreateTestCases(BsonDocument document)

tests/MongoDB.Bson.Tests/Specifications/bson-decimal128/TestRunner.cs renamed to tests/MongoDB.Driver.Tests/Specifications/bson-decimal128/TestRunner.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
using System.Linq;
2020
using System.Reflection;
2121
using FluentAssertions;
22+
using MongoDB.Bson;
2223
using MongoDB.Bson.IO;
2324
using MongoDB.Bson.Serialization;
2425
using MongoDB.Bson.Serialization.Serializers;
2526
using Xunit;
2627

27-
namespace MongoDB.Bson.Specifications.bson_decimal128
28+
namespace MongoDB.Driver.Tests.Specifications.bson_decimal128
2829
{
2930
public class TestRunner
3031
{
@@ -158,7 +159,7 @@ private class TestCaseFactory : IEnumerable<object[]>
158159
{
159160
public IEnumerator<object[]> GetEnumerator()
160161
{
161-
const string prefix = "MongoDB.Bson.Tests.Specifications.bson_decimal128.tests.";
162+
const string prefix = "MongoDB.Driver.Tests.Specifications.bson_decimal128.tests.";
162163
var executingAssembly = typeof(TestCaseFactory).GetTypeInfo().Assembly;
163164
var enumerable = executingAssembly
164165
.GetManifestResourceNames()

tests/MongoDB.Driver.Core.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs renamed to tests/MongoDB.Driver.Tests/Specifications/connection-monitoring-and-pooling/ConnectionMonitoringAndPoolingTestRunner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
using Moq;
4343
using Xunit;
4444

45-
namespace MongoDB.Driver.Specifications.connection_monitoring_and_pooling
45+
namespace MongoDB.Driver.Tests.Specifications.connection_monitoring_and_pooling
4646
{
4747
[Trait("Category", "Pool")]
4848
public class ConnectionMonitoringAndPoolingTestRunner
@@ -810,7 +810,7 @@ private void WaitForThread(BsonDocument operation, ConcurrentDictionary<string,
810810
// nested types
811811
private class TestCaseFactory : JsonDrivenTestCaseFactory
812812
{
813-
protected override string PathPrefix => "MongoDB.Driver.Core.Tests.Specifications.connection_monitoring_and_pooling.tests.cmap_format.";
813+
protected override string PathPrefix => "MongoDB.Driver.Tests.Specifications.connection_monitoring_and_pooling.tests.cmap_format.";
814814

815815
protected override IEnumerable<JsonDrivenTestCase> CreateTestCases(BsonDocument document)
816816
{

0 commit comments

Comments
 (0)