Skip to content

Update unit tests to Microsoft.CodeAnalysis.Testing#2751

Merged
sharwell merged 37 commits intoDotNetAnalyzers:masterfrom
sharwell:testing-library
Sep 12, 2018
Merged

Update unit tests to Microsoft.CodeAnalysis.Testing#2751
sharwell merged 37 commits intoDotNetAnalyzers:masterfrom
sharwell:testing-library

Conversation

@sharwell
Copy link
Copy Markdown
Member

@sharwell sharwell commented Aug 9, 2018

I was looking at dotnet/roslyn-sdk#123 and considering what it might look like to switch from a source code distribution to a NuGet-based distribution. This is a proof of concept that preserves much of the original form used for testing StyleCop Analyzers, but separates the StyleCop Analyzers-specific items from the base testing support.

/cc @mavasani @DustinCampbell @jmarolf @JohanLarsson

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 9, 2018

Codecov Report

Merging #2751 into master will increase coverage by 0.01%.
The diff coverage is 99.56%.

@@            Coverage Diff             @@
##           master    #2751      +/-   ##
==========================================
+ Coverage   97.38%   97.39%   +0.01%     
==========================================
  Files         752      752              
  Lines       99590    97181    -2409     
  Branches     3267     3171      -96     
==========================================
- Hits        96982    94652    -2330     
+ Misses       1738     1680      -58     
+ Partials      870      849      -21

@JohanLarsson
Copy link
Copy Markdown

Why pass in explicit empty collection of diagnostic results when testing valid code?

await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);

vs

await VerifyValidAsync(testCode).ConfigureAwait(false);

Also removing async:

VerifyValid(testCode);

* DiagnosticResult
* EmptyCodeFixProvider
* MetadataReferences
* SourceFileCollection
* SourceFileList
@sharwell sharwell force-pushed the testing-library branch 2 times, most recently from 92a3a0d to 183b7fc Compare September 4, 2018 11:36
@sharwell
Copy link
Copy Markdown
Member Author

@vweijsters @pdelvo @JohanLarsson This is now ready for review. After getting a sense of the changes from looking at a few updated test classes, I recommend reviewing the more recent commits to understand the direction change. The merge commits are helpful as well, e.g. 7781c99 shows how the tests added in #2779 were updated to account for the new library.

@sharwell

This comment has been minimized.

Copy link
Copy Markdown
Member

@pdelvo pdelvo left a comment

Choose a reason for hiding this comment

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

I reviewed the main changes and took a look at some (not all) of the test classes. Those changes look good to me.

@sharwell sharwell changed the title Proof of concept update to library-style testing Update unit tests to Microsoft.CodeAnalysis.Testing Sep 12, 2018
@sharwell sharwell merged commit e8d87e2 into DotNetAnalyzers:master Sep 12, 2018
@sharwell sharwell deleted the testing-library branch September 12, 2018 17:48
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.

3 participants