FxCopAnalyzer fixes for Wox.Test (#7312)

* Added InvarientCulture info (CA1305: Specify IFormatProvider)

* Removed underscore from method names (CA1707: Identifiers should not contain underscores)

* Marked members as static (CA1822: Mark members as static)

* Removed initialization for DummyTestClass::IsFunctionCalled (CA1805: Do not initialize unnecessarily)

* Replaced Count with Any (CA1827: Do not use Count/LongCount when Any can be used)

* Changed WoxTest::DummyTestClass to private (CA1034: Nested types should not be visible)

* Suppressed warnings for uninstantiated internal classes used as TestFixtures (CA1812: Avoid uninstantiated internal classes)

* Enabled FxCopAnalyzer for Wox.Test

* Added suppression message for CA1812 in GlobalSuppressions.cs and removed inline supression messages (CA1812: Avoid uninstantiated internal classes)

* Changed InvariantCulture to Ordinal where appropriate

* Addressing comments: Updated justification for CA1812 in GlobalSuppressions.cs (Avoid uninstantiated internal classes)
This commit is contained in:
Avneet Kaur
2020-10-21 20:13:12 -07:00
committed by GitHub
parent dd2627dbbc
commit cfe9e2328f
7 changed files with 86 additions and 64 deletions

View File

@@ -14,9 +14,9 @@ namespace Wox.Test
public class WoxTest
{
// A Dummy class to test that OnPropertyChanged() is called while we set the variable
public class DummyTestClass : BaseModel
private class DummyTestClass : BaseModel
{
public bool IsFunctionCalled { get; set; } = false;
public bool IsFunctionCalled { get; set; }
private ICommand _item;
@@ -45,7 +45,7 @@ namespace Wox.Test
}
[Test]
public void AnyVariable_MustCallOnPropertyChanged_WhenSet()
public void AnyVariableMustCallOnPropertyChangedWhenSet()
{
// Arrange
DummyTestClass testClass = new DummyTestClass();