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

Unit tests for walletOperations, and cypress test #97

Merged
merged 8 commits into from
May 23, 2024

Conversation

itailiors
Copy link
Collaborator

No description provided.

@itailiors
Copy link
Collaborator Author

itailiors commented May 22, 2024

Unit Tests for WalletOperations:

Added tests for wallet word generation, transaction handling with sufficient and insufficient funds, unspent output retrieval, and transaction fee calculation.

Cypress Tests :

added a test for browse a project, and then invest

}

[Fact]
public void CalculateTransactionFee_WithMultipleScenarios()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dangershony glad if you could go over the logic of this test,
mostly on the values, and if there is no need for Assert.Equal(0.00000001m, calculatedFeeSufficient);

// Act & Assert for sufficient funds
var calculatedFeeSufficient = walletOperations.CalculateTransactionFee(sendInfoSufficientFunds, accountInfo, feeRate);
Assert.True(calculatedFeeSufficient > 0);
Assert.Equal(0.00000001m, calculatedFeeSufficient); // Assuming an expected fee for validation
Copy link
Member

Choose a reason for hiding this comment

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

this is fine, the fee is exactly the same every time because the size of the trx is fixed and feerate is fixed, so it is fine to keep it.

@dangershony dangershony merged commit a9c63b6 into main May 23, 2024
4 checks passed
@dangershony dangershony deleted the test-for-wallet-add-cypress branch May 23, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants