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

feat(switch): add support for Switch #97

Merged
merged 4 commits into from
Oct 27, 2022
Merged

Conversation

ntbm
Copy link
Contributor

@ntbm ntbm commented Oct 1, 2022

Closes #21

@aloisdg aloisdg added enhancement New feature or request hacktoberfest Hacktoberfest encourages participation in the open source community, which grows bigger every year. hacktoberfest-accepted labels Oct 1, 2022
@aloisdg
Copy link
Member

aloisdg commented Oct 2, 2022

The tests are failing. Could you fix them?

A total of 1 test files matched the specified pattern.
  Failed ShouldIdentifyAsMaestros("6759710000901011") [66 ms]
  Error Message:
     Expected is <DEdge.CardType[3]>, actual is <System.Linq.Enumerable+WhereSelectArrayIterator`2[DEdge.Model.ICard,DEdge.CardType]>
  Values differ at index [2]
  Expected: GPN
  But was:  Switch

source: https://github.com/d-edge/Cardidy/actions/runs/3164565462/jobs/5156547997#step:6:1

Switch's 6759 is shared with Maestro and Maestro UK. Edit

[TestCase("6759710000901011", ExpectedResult = new[] { CardType.MaestroUk, CardType.Maestro, CardType.GPN })]
[TestCase("6759710000901086", ExpectedResult = new[] { CardType.MaestroUk, CardType.Maestro, CardType.GPN })]

to be

[TestCase("6759710000901011", ExpectedResult = new[] { CardType.MaestroUk, CardType.Maestro, CardType.Switch, CardType.GPN })]
[TestCase("6759710000901086", ExpectedResult = new[] { CardType.MaestroUk, CardType.Maestro, CardType.Switch, CardType.GPN })]

source:

[TestCase("6011-773331987017", ExpectedResult = new[] { CardType.Discover, CardType.RuPay, CardType.GPN })]

Payment card are weird sometimes. Thanks for your work 👍

@ntbm
Copy link
Contributor Author

ntbm commented Oct 2, 2022

Repushed a signed version of the code.
Also fixed the tests.
Sorry for not running them before and also thank you for providing me an opportunity to learn about payment cards :)

@aloisdg
Copy link
Member

aloisdg commented Oct 2, 2022

You are welcome. Thanks for you work!

src/DEdge.Cardidy/Model/Cards.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@torendil torendil left a comment

Choose a reason for hiding this comment

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

Hey! LGTM :)

@aloisdg aloisdg changed the title Add support for Switch feat(switch): add support for Switch Oct 27, 2022
@aloisdg aloisdg merged commit 22c62dc into d-edge:main Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Hacktoberfest encourages participation in the open source community, which grows bigger every year. hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Switch
3 participants