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

Use XDocument #6

Closed
wants to merge 2 commits into from
Closed

Use XDocument #6

wants to merge 2 commits into from

Conversation

SimonCropp
Copy link

re this VerifyTests/Verify#585

the reason Verify doesnt have a VerifyXml is that i assumed it was sufficient to have support for XDocument.

XDocument is the current recommended way to build up an xml string.

In this PR i changed ExportFull over to returning a XDocument. That can then be passed directly to Verifier.Verify.

side note Verify also has support for XmlNode, XmlDocument, and XElement.

@SimonCropp SimonCropp changed the title Use x document Use XDocument Aug 11, 2022
@SimonCropp
Copy link
Author

let me know if u want the rest converted

@emilybache
Copy link
Owner

Thankyou for telling me about Verify features for xml that I didn't know about!

This repo is an exercise and it's designed to look like legacy code. Returning a String is totally deliberate. You've changed the starting position to return an XDocument and that's basically part of the exercise that I want students to do. So no, I don't want this change in the XmlExporter class.

The first part of the exercise is to add approval tests, and the second part is to refactor and for example change it to use XDocument. On the 'with_tests' branch i have a positioned the code between part 1 and part 2 of the exercise.

I think what I understand from you is that you don't want to add a 'VerifyXml' to Verifier. Perhaps we could discuss that further in the other github issue.

@emilybache
Copy link
Owner

Thanks again for your contribution. I updated the code slightly differently now, to preserve the starting position in XmlExporter. What do you think?

@SimonCropp SimonCropp closed this Oct 28, 2022
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