-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
These are MSTest 4.0 analyzer warnings that I suppressed because the projects have TreatWarningsAsErrors=true.
┌────────────┬─────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Code │ Rule │ What it detects │
├────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ MSTEST0001 │ Parallelization setting │ Project doesn't explicitly enable/disable test parallelization via [Parallelize] or [DoNotParallelize] assembly attribute │
├────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ MSTEST0017 │ Swapped arguments │ Assert.AreEqual(actual, expected) instead of correct order Assert.AreEqual(expected, actual) │
├────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ MSTEST0037 │ Use specific asserts │ Using generic asserts like Assert.IsTrue(list.Count == 5) instead of Assert.HasCount(list, 5) │
├────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ MSTEST0044 │ Obsolete attribute │ Using [DataTestMethod] which is now obsolete - should use [TestMethod] instead │
├────────────┼─────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ MSTEST0052 │ DynamicData argument │ Using explicit DynamicDataSourceType argument that's no longer needed (auto-detected) │
└────────────┴─────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
These analyzers come with MSTest.Analyzers (transitive dependency of MSTest 4.0). In pipeline-dotnet they're just warnings, but in device-detection-dotnet they become errors due to TreatWarningsAsErrors.
Proper Fix
The proper fix would be to update the test code to follow the new patterns, but that requires more extensive changes. Suppressing them allows the build to succeed while keeping the existing test behavior.
Metadata
Metadata
Assignees
Labels
No labels