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

Add Support for TCG Player mobile app's CSV format #54

Closed
AaronLS opened this issue Feb 16, 2020 · 5 comments
Closed

Add Support for TCG Player mobile app's CSV format #54

AaronLS opened this issue Feb 16, 2020 · 5 comments

Comments

@AaronLS
Copy link
Contributor

AaronLS commented Feb 16, 2020

TCG Player's card scanning mobile app let's you export your collection to a CSV file. Add support for import of the CSV file.

@AaronLS AaronLS changed the title Add Support for TCg Player mobile app Add Support for TCG Player mobile app's CSV format Feb 16, 2020
@AaronLS
Copy link
Contributor Author

AaronLS commented Feb 16, 2020

Working import:
AaronLS@c8951f8

  • Will cleanup and do more testing.
  • Add test cases
  • Create pull request

@AaronLS
Copy link
Contributor Author

AaronLS commented Feb 16, 2020

@NikolayXHD I take it Foils are not supported? The TCG player CSV breaks out cards by foils but looks like mtgdb gui doesn't support yet? Or am I not seeing where that is set?

@NikolayXHD
Copy link
Owner

Hi @AaronLS, you are right, foils are not supported. I have an issue #52, to support foils, not coming soon though, as it has great impact on application logic.

@AaronLS
Copy link
Contributor Author

AaronLS commented May 20, 2020

I was working on the unit test with two test artifacts embedded using:
[TestCase(@"TestArtifacts\TcgCsvDeckFormatterInputTestCase.csv", @"TestArtifacts\Reference.json")]

This allows the test files to just sit in a folder under the test project so anyone can run the unit test without having specific paths setup. The two files would contain same cards, but in two different formats.

The test would deserialize the TCG CSV format using my new DeckFormatter, then deserialize the reference JSON using existing TcgParser.cs, then compare the resulting objects to verify both resulted in the same cards.

So the JSON acts as the reference set of cards to compare results against for consistency.

Technically this isn't a pure unit test, as it's exercising both the new deck formatter as well as TcgParser. Parsing JSON is pretty straightforward though, so I think if it as just a utility to load in a reference set of cards for comparison against.

If there were edge cases of problematic cards we wanted to add so the test is more thorough, it'd be a simple process to add them into the reference.json and CSV without making any code changes.

Is this approach fine with you?

@NikolayXHD
Copy link
Owner

NikolayXHD commented May 21, 2020

Is this approach fine with you?

Absolutely

Technically this isn't a pure unit test

To me this is rather a good thing. I am of opinion that most errors happen between units of code, so less "unit" tests are more likely to help :) I wish I had end-to-end tests in Mtgdb.Gui to catch bugs in final application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants