[xUnit] Fix issues on TemplatesTest file #4562
Merged
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.
Addresses #4349
Description
This PR fixes the xUnit1013, xUnit2000, xUnit2004, xUnit2009, xUnit2013, and xUnit2017 issues in TemplatesTest file of Microsoft.Bot.Builder.LanguageGeneration.Tests project.
Specific Changes
- Fixed xUnit1013 by marking the TestMemoryAccessPath method as fact (this test was ignored and it's now executed).
- Fixed xUnit2000 by swapping the arguments of the Assert.Equal statements.
- Fixed xUnit2004 by replacing Assert.Equal with Assert.True to check for boolean conditions.
- Fixed xUnit2009 by replacing the Assert.True with Assert.Contains when checking for substrings.
- Fixed xUnit2013 by changing the Assert.Equal with Assert.Single or Assert.Empty when checking for collections length.
- Fixed xUnit2017 by changing the Assert.True with Assert.Contains to check if a value exists on a collection.
- Use var instead of a specific type in variables.
- Removed unused variable templates in TestInjectLG.
- Fixed typos.
Testing
The next image shows the tests passing after the changes made:
