Skip to content

Fix Ocelot.Data.Currency functions not working with negative Cents values #227

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

Merged
merged 3 commits into from
Mar 4, 2022

Conversation

arthurxavierx
Copy link
Contributor

What does this pull request do?

The Ocelot.Data.Currency.formatCentsToStrDollars and Ocelot.Data.Currency.parseCentsFromDollarStr did not work with negative Cents values. We fix that by changing their definitions and adding test cases to cover the intended behavior.

Where should the reviewer start?

Commit-by-commit.

How should this be manually tested?

There's no need for manual testing; the automated tests should be enough.

In this commit we add test cases for negative `Cents` value and a
property test for the interaction between `parseCentsFromDollarStr` and
`formatCentsToStrDollars`. These tests are failing at the moment and we
fix the code and get them to pass in the next commit.
Previously these functions did not work properly with negative `Cents`
values.
Copy link
Member

@davezuch davezuch left a comment

Choose a reason for hiding this comment

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

Looks good!

@davezuch davezuch enabled auto-merge March 3, 2022 19:27
@boygao1992 boygao1992 disabled auto-merge March 3, 2022 19:29
@boygao1992
Copy link
Member

@arthurxavierx Don't forget to bump version like this and make a release.

@arthurxavierx arthurxavierx enabled auto-merge March 3, 2022 20:18
@arthurxavierx
Copy link
Contributor Author

@boygao1992 Do you know why the CircleCI build hasn't finished yet?

@boygao1992
Copy link
Member

Hmm I don't see this PR on the job list.
image

@boygao1992
Copy link
Member

boygao1992 commented Mar 4, 2022

Weird, I just opened a new branch and the CI is triggered.
image

Maybe try pushing to a different branch?

@boygao1992
Copy link
Member

@arthurxavierx I just did that for you creating a new branch arthur/negative-cents-2 and the CI is running. Is it possible to switch this PR to that branch? If not, probably have to open a new PR.

@arthurxavierx arthurxavierx merged commit e8e271c into main Mar 4, 2022
@arthurxavierx arthurxavierx deleted the arthur/negative-cents branch March 4, 2022 15:25
@arthurxavierx
Copy link
Contributor Author

@boygao1992 Oh it seems like the original branch got built and already merged for some reason 😶 Thank you!

@boygao1992
Copy link
Member

Nvm, since both branches are on the same commit. That CI passing triggered the auto merge.

@boygao1992
Copy link
Member

No problem!

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.

3 participants