-
Notifications
You must be signed in to change notification settings - Fork 352
Move to newer xunit.analyzers package #96
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
Comments
dougbu
added a commit
that referenced
this issue
Oct 31, 2017
- work around xunit/xunit#1502 - should restore as part of a #96 fix
dougbu
added a commit
that referenced
this issue
Nov 1, 2017
….Web.Razor.Test to end - part of #65 Few manual changes: - temporarily remove xUnit analyzers from System.Web.Razor.Test - work around xunit/xunit#1502 - should restore analyzers as part of a #96 fix - use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values - avoid xUnit1013, Public method should be marked as test - mark a helper method `internal` - fix xUnit1026, `[Theory]` method doesn't use all parameters - add new data set properties - suppress xUnit2013, Do not use equality check to check for collection size. - calls `Count` because the `Mock<T>` does not set up `GetEnumerable()` - `Assert.Equal<T>(...)` -> `Assert.Equal(...)` - avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
FYI, 0.8.0 is available with fixes for all those issues. |
Thanks @marcind ! And, congrats on the new release. |
Closing as the workarounds we have in place seem to be working, and this is not a priority work to focus on. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current xunit.analyzers package (v0.7.0) is not a stable version, contains a few bugs, and we have workarounds in our test code for some of those bugs. Nothing newer is available. But, when the package is updated…
Relevant bugs and the workarounds we could remove after moving to new analyzer package:
xUnit1013
suppression inMediaTypeFormatterTestBase<TFormatter>
InvalidCastException
thrown inAssertEqualShouldNotBeUsedForCollectionSizeCheck
xunit/xunit#1502,InvalidCastException
thrown inAssertEqualShouldNotBeUsedForCollectionSizeCheck
'b' - '\0'
expressions inLookaheadTextReaderTestBase
back to just'b'
AssertEqualShouldNotBeUsedForBoolLiteralCheck
false positives xunit/xunit#1505, AvoidAssertEqualShouldNotBeUsedForBoolLiteralCheck
false positivesAssert.Equal(...)
e.g. changeAssert.Equal((object)true, ex.Data["WebPages.VersionChange"]);
back toAssert.Equal(true, ex.Data["WebPages.VersionChange"]);
The text was updated successfully, but these errors were encountered: