Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSHARP-5402: Add missing reference for MongoDB.Driver.Encryption.Test project #1537

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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