Skip to content

Commit 5a7da05

Browse files
authored
CSHARP-5402: Add missing reference for MongoDB.Driver.Encryption.Test project (#1537)
1 parent 4a669d3 commit 5a7da05

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

build.cake

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Task("TestServerlessNet60").IsDependentOn("TestServerless");
222222
Task("TestLibMongoCrypt")
223223
.IsDependentOn("Build")
224224
.DoesForEach(
225-
items: GetFiles("./**/MongoDB.Libmongocrypt.Tests.csproj"),
225+
items: GetFiles("./**/MongoDB.Driver.Encryption.Tests.csproj"),
226226
action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject));
227227

228228
Task("TestLoadBalanced")

tests/MongoDB.Driver.Encryption.Tests/BasicTests.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ private static KmsKeyId CreateKmsKeyId(string kmsName, string endPoint = null, I
563563
return new KmsKeyId(datakeyOptionsDocument.ToBson(), keyAltNameBuffers);
564564
}
565565

566-
private CryptOptions CreateOptions()
566+
private static CryptOptions CreateOptions()
567567
{
568568
return new CryptOptions(
569569
new[]
@@ -573,7 +573,7 @@ private CryptOptions CreateOptions()
573573
});
574574
}
575575

576-
private (Binary binarySent, BsonDocument document) ProcessContextToCompletion(CryptContext context, bool isKmsDecrypt = true)
576+
private static (Binary binarySent, BsonDocument document) ProcessContextToCompletion(CryptContext context, bool isKmsDecrypt = true)
577577
{
578578
BsonDocument document = null;
579579
Binary binary = null;
@@ -591,7 +591,7 @@ private CryptOptions CreateOptions()
591591
/// Returns (stateProcessed, binaryOperationProduced, bsonOperationProduced)
592592
/// </summary>
593593
/// <exception cref="NotImplementedException"></exception>
594-
private (CryptContext.StateCode stateProcessed, Binary binaryProduced, BsonDocument bsonOperationProduced) ProcessState(CryptContext context, bool isKmsDecrypt = true)
594+
private static (CryptContext.StateCode stateProcessed, Binary binaryProduced, BsonDocument bsonOperationProduced) ProcessState(CryptContext context, bool isKmsDecrypt = true)
595595
{
596596
_output.WriteLine("\n----------------------------------\nState:" + context.State);
597597
switch (context.State)
@@ -678,7 +678,7 @@ private CryptOptions CreateOptions()
678678
throw new NotImplementedException();
679679
}
680680

681-
private CryptContext StartExplicitEncryptionContextWithKeyId(CryptClient client, byte[] keyId, string encryptionAlgorithm, byte[] message)
681+
private static CryptContext StartExplicitEncryptionContextWithKeyId(CryptClient client, byte[] keyId, string encryptionAlgorithm, byte[] message)
682682
{
683683
return client.StartExplicitEncryptionContext(keyId, keyAltName: null, queryType: null, contentionFactor: null, encryptionAlgorithm, message, rangeOptions: null);
684684
}
@@ -732,7 +732,9 @@ static BsonDocument ReadJsonTestFile(string file)
732732
}
733733

734734
// Work around C# drivers and C driver have different extended json support
735+
#pragma warning disable CA1307
735736
text = text.Replace("\"$numberLong\"", "$numberLong");
737+
#pragma warning restore CA1307
736738

737739
return BsonUtil.FromJSON(text);
738740
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\BuildProps\Tests.Build.props" />
23

34
<PropertyGroup>
45
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
@@ -11,7 +12,6 @@
1112
</PropertyGroup>
1213

1314
<ItemGroup>
14-
<PackageReference Include="FluentAssertions" Version="5.6.0" />
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
1616
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
1717
</ItemGroup>

0 commit comments

Comments
 (0)