Skip to content

CSHARP-5392: Add integration tests for transactions write concern behavior #1733

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adelinowona
Copy link
Contributor

No description provided.

@adelinowona adelinowona requested a review from BorisDog July 16, 2025 21:17
@adelinowona adelinowona requested a review from a team as a code owner July 16, 2025 21:17
@adelinowona adelinowona added the chore Label to hide PR from generated Release Notes label Jul 16, 2025
@rstam rstam removed the request for review from a team July 17, 2025 16:18
namespace MongoDB.Driver.Tests.Specifications.transactions
{
[Trait("Category", "Integration")]
public class TransactionsProseTests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make it inherit from LoggableTestClass, so we get logs on failure.

[Trait("Category", "Integration")]
public class TransactionsProseTests
{
private string _collectionName = "txn-test-col";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constant?

// https://github.com/mongodb/specifications/blob/fc7996db26d0ea92091a5034c6acb287ef7282fe/source/transactions/tests/README.md#10-write-concern-not-inherited-from-collection-object-inside-transaction
[Theory]
[ParameterAttributeData]
public async void Ensure_write_concern_is_not_inherited_from_collection_object_inside_transaction([Values(false, true)] bool async)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async Task?

}
}

exception.Should().BeNull();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to use Record in order to validate the absence of exception. The test will just fail on exception.
It's usually used to validate that exception was thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Label to hide PR from generated Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants