Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix for Base32 Bug #26

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
KvanTTT merged 7 commits into KvanTTT:master from Xor-el:FixForBase32Bug
Dec 18, 2016
Merged

Fix for Base32 Bug #26

KvanTTT merged 7 commits into KvanTTT:master from Xor-el:FixForBase32Bug
Dec 18, 2016

Conversation

Copy link
Contributor

@Xor-el Xor-el commented Dec 18, 2016
edited
Loading

More Details #25

Copy link
Owner

@KvanTTT KvanTTT left a comment

Choose a reason for hiding this comment

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

Could you please use spaces instead of tabs for more convenient diff? Other repository files also use spaces.

Copy link
Contributor Author

Xor-el commented Dec 18, 2016

Sorry If I sound stupid but could you please explain better or may be show me a sample??
pretty new to this pull request thingy.

Copy link
Owner

KvanTTT commented Dec 18, 2016

If you use Visual Studio, click Edit -> Advanced -> View White Space. After that you will be able to see all whitespace characters: whitespaces (⋅⋅⋅⋅) and tabs (→). In this project I use the first ones. But you use the second. So, just replace tabs on whitespaces and make me happy :)

Adjusted to use same formatting as other files in the project.
Copy link
Contributor Author

Xor-el commented Dec 18, 2016

Thanks for the Information.
Done as Requested.

Copy link
Owner

@KvanTTT KvanTTT left a comment

Choose a reason for hiding this comment

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

Can you add a unit test here that not passed with the previous wrong code? I mean your sample with KJXW4YLMMQ====== string.

Added Unit Tests.
Copy link
Contributor Author

Xor-el commented Dec 18, 2016

Done.

string encoded = Converter.EncodeString(str);
string decoded = Converter.DecodeToString(encoded);

Assert.AreEqual(decoded, encoded);
Copy link
Owner

Choose a reason for hiding this comment

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

I guess this is a misprint and you mean the following code?

Assert.AreEqual(str, decoded);

}

[TestCase(Base32SampleString)]
public void Base32CompareEncodeandDecode(string str)
Copy link
Owner

@KvanTTT KvanTTT Dec 18, 2016
edited
Loading

Choose a reason for hiding this comment

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

We use CamelCase for all words: Base32CompareEncodeAndDecode.
Better name with below comment considering: Base32CompareSourceAndDecoded.

public const string Base32SampleStringResult = "KJXW4YLMMQ======";

[TestCase(Base32SampleString)]
public void Base32EncodeCompareToConstantValue(string str)
Copy link
Owner

Choose a reason for hiding this comment

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

Base32CompareEncodedAndExpected

Copy link
Contributor Author

Xor-el commented Dec 18, 2016

All Changes Applied as Requested.

Copy link
Owner

KvanTTT commented Dec 18, 2016

Not all :) Please replace Assert.AreEqual(str, encoded); with Assert.AreEqual(str, decoded);.

Copy link
Contributor Author

Xor-el commented Dec 18, 2016

Lol, Done.

@KvanTTT KvanTTT merged commit 0ff3cc8 into KvanTTT:master Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@KvanTTT KvanTTT KvanTTT left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /