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

fix: FIR-33174: parse boolean in old (0/1) and new (false/true) formats #86

Merged
merged 1 commit into from
May 22, 2024

Conversation

alexradzin
Copy link
Collaborator

No description provided.

@alexradzin alexradzin requested a review from a team as a code owner May 22, 2024 08:44
Copy link

github-actions bot commented May 22, 2024

File Coverage Missing
All files 80%
FireboltDoNetSdk.Utils.TypesConverter 80% 90
FireboltDotNetSdk.Client.FireboltDataReader 81% 126-128 144-146 176-178 216-217 230-232 248-250 305-306 329-331 364-366 382-384 400-402 460-461 485-486 519-528

Minimum allowed coverage is 80%

Generated by 🐒 cobertura-action against 0b02579

@alexradzin alexradzin force-pushed the FIR-33174-parse-boolean-in-old-format branch from 64a0bde to 400593d Compare May 22, 2024 09:31
public static bool ParseBoolean(string str)
{
bool b;
return booleanValues.TryGetValue(str, out b) ? b : throw new FormatException($"String '{str}' was not recognized as a valid Boolean.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be a case-insensitive comparison? For cases like True and TRUE?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In fact it should support both true and True because string value arrives here after calling ToString() that turns true into string True and false into string False.

I agree that this is not obvious, so I can either add this text as a comment or add entries for True and False to the dictionary. What do you prefer?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. Eh, just a comment here is fine so we don't forget.

Copy link
Collaborator

@ptiurin ptiurin left a comment

Choose a reason for hiding this comment

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

lgtm

public static bool ParseBoolean(string str)
{
bool b;
return booleanValues.TryGetValue(str, out b) ? b : throw new FormatException($"String '{str}' was not recognized as a valid Boolean.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see. Eh, just a comment here is fine so we don't forget.

@alexradzin alexradzin force-pushed the FIR-33174-parse-boolean-in-old-format branch from 524d008 to e2efab2 Compare May 22, 2024 11:29
@alexradzin alexradzin force-pushed the FIR-33174-parse-boolean-in-old-format branch from e2efab2 to 0b02579 Compare May 22, 2024 11:33
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@alexradzin alexradzin merged commit c6f51ad into main May 22, 2024
8 checks passed
@alexradzin alexradzin deleted the FIR-33174-parse-boolean-in-old-format branch May 22, 2024 11:36
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