You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Newly added functionality enabling easy move from MSTest Asserts to fluent assertions does not work if Assert is not on the top level of nesting in a test method.
Complete minimal example reproducing the issue
This will get a suggestion:
using Microsoft.VisualStudio.TestTools.UnitTesting;namespaceTestProject1{[TestClass]publicclassUnitTest1{[TestMethod]publicvoidTestMethod1(){
Assert.AreEqual(1,1);}}}
Suggestion to use fluent assertions instead of Assert is shown when Assert is not on the top level of nesting in a test method.
Actual behavior:
Suggestion to use fluent assertions instead of Assert is not shown when Assert is not on the top level of nesting in a test method.
Versions
Which version of Fluent Assertions Analyzers are you using? FluentAssertions.Analyzers 0.17.2
Which .NET runtime and version are you targeting? .NET Core 3.1.
The text was updated successfully, but these errors were encountered:
robertMSFTE
changed the title
uggestions to use fluent assertions instead of MSTest Asserts do not work if Assert is not on the top level of nesting in a test method
Suggestions to use fluent assertions instead of MSTest Asserts do not work if Assert is not on the top level of nesting in a test method
Apr 4, 2022
Description
Newly added functionality enabling easy move from MSTest Asserts to fluent assertions does not work if Assert is not on the top level of nesting in a test method.
Complete minimal example reproducing the issue
This will get a suggestion:
But this will not:
Expected behavior:
Suggestion to use fluent assertions instead of Assert is shown when Assert is not on the top level of nesting in a test method.
Actual behavior:
Suggestion to use fluent assertions instead of Assert is not shown when Assert is not on the top level of nesting in a test method.
Versions
The text was updated successfully, but these errors were encountered: