Xunitcodegen#4020
Closed
tznind wants to merge 25 commits intogui-cs:v2_developfrom
Closed
Conversation
Collaborator
Author
|
@tig this should make your asserts much easier in menu branch. No more passing lamdas and works for all assert methods (true, starts with, IsType etc). I think for Application members we can just manually add the methods for now. SendKeys and Focus are the only new ones added recently, and I don't imagine there will be all that many more Only issue I've had is sometimes having to close and re open visual studio before autocomplete works following changes to code gen (i.e. to see the new members) I did look to see if it was possible yo bring in the xmldoc too but looks impossible/complicated because code gen builds from the symbol source not original source |
8 tasks
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
This is a super set of #4015 which is when I started working on this
Noteworthy
I had to change the package version from
4.13,5to4.12.0on the CSharp and Analyzers code gen dependencies - otherwise I got warnings. I don't see any issues doing this but am happy to discuss if others have any build issues.UPDATE: CI wanted a different version so I set it in the props to use either which seems to work with locally and in CI now.
I created this repo to help understand how codegen works: https://github.com/tznind/CodeGenerationExample
Proposed Changes/Todos
Adds all xunit methods (e.g.
Assert.Falseto the fluent API as concatenated name e.g.AssertFalse)How does it work?
We create an xunit project that is empty
We create a code generator project that creates code in the empty project
Result is that when compiled the empty project contains generated static extension methods to the fluent context that perform the asserts and shutdown safely:
Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)