Skip to content

Commit

Permalink
CSHARP-5402: Add missing reference for MongoDB.Driver.Encryption.Test…
Browse files Browse the repository at this point in the history
… project (mongodb#1537)
  • Loading branch information
adelinowona authored Nov 7, 2024
1 parent 4a669d3 commit 5a7da05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Task("TestServerlessNet60").IsDependentOn("TestServerless");
Task("TestLibMongoCrypt")
.IsDependentOn("Build")
.DoesForEach(
items: GetFiles("./**/MongoDB.Libmongocrypt.Tests.csproj"),
items: GetFiles("./**/MongoDB.Driver.Encryption.Tests.csproj"),
action: (BuildConfig buildConfig, Path testProject) => RunTests(buildConfig, testProject));

Task("TestLoadBalanced")
Expand Down
10 changes: 6 additions & 4 deletions tests/MongoDB.Driver.Encryption.Tests/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ private static KmsKeyId CreateKmsKeyId(string kmsName, string endPoint = null, I
return new KmsKeyId(datakeyOptionsDocument.ToBson(), keyAltNameBuffers);
}

private CryptOptions CreateOptions()
private static CryptOptions CreateOptions()
{
return new CryptOptions(
new[]
Expand All @@ -573,7 +573,7 @@ private CryptOptions CreateOptions()
});
}

private (Binary binarySent, BsonDocument document) ProcessContextToCompletion(CryptContext context, bool isKmsDecrypt = true)
private static (Binary binarySent, BsonDocument document) ProcessContextToCompletion(CryptContext context, bool isKmsDecrypt = true)
{
BsonDocument document = null;
Binary binary = null;
Expand All @@ -591,7 +591,7 @@ private CryptOptions CreateOptions()
/// Returns (stateProcessed, binaryOperationProduced, bsonOperationProduced)
/// </summary>
/// <exception cref="NotImplementedException"></exception>
private (CryptContext.StateCode stateProcessed, Binary binaryProduced, BsonDocument bsonOperationProduced) ProcessState(CryptContext context, bool isKmsDecrypt = true)
private static (CryptContext.StateCode stateProcessed, Binary binaryProduced, BsonDocument bsonOperationProduced) ProcessState(CryptContext context, bool isKmsDecrypt = true)
{
_output.WriteLine("\n----------------------------------\nState:" + context.State);
switch (context.State)
Expand Down Expand Up @@ -678,7 +678,7 @@ private CryptOptions CreateOptions()
throw new NotImplementedException();
}

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

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

return BsonUtil.FromJSON(text);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BuildProps\Tests.Build.props" />

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
Expand All @@ -11,7 +12,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
Expand Down

0 comments on commit 5a7da05

Please sign in to comment.