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

StringExtensions Unit Tests #13657

Merged
merged 3 commits into from
May 11, 2023
Merged

StringExtensions Unit Tests #13657

merged 3 commits into from
May 11, 2023

Conversation

agriffard
Copy link
Member

Testing GitHub Copilot to generate Unit Tests.

{
public class StringExtensionsTests
{
[Fact]
Copy link
Member

@hishamco hishamco May 7, 2023

Choose a reason for hiding this comment

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

We could use Theory for both test cases 1 & 3

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, using Theory in test case 1 & 3.

{
[Theory]
[InlineData(new byte[]{ 10, 20, 30 }, "0A141E")]
public void ToHexString_ReturnsCorrectHexString(byte[] bytes, string expected)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public void ToHexString_ReturnsCorrectHexString(byte[] bytes, string expected)
[InlineData(new byte[0], "")]
public void ToHexString_ReturnsCorrectHexString(byte[] bytes, string expected)

@agriffard agriffard merged commit 1f128bb into main May 11, 2023
@agriffard agriffard deleted the ag/stringExtensionsTests branch May 11, 2023 10:03
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