Skip to content

Commit 7e61476

Browse files
CopilotMalcolmnixon
andcommitted
Fix MSTest 4.0 analyzer errors for Dependabot update
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent faa561e commit 7e61476

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
3+
// Enable test parallelization at the method level
4+
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]

test/DemaConsulting.DotnetToolWrapper.Tests/IntegrationTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public void TestMissingConfigFile()
141141

142142
// Assert
143143
Assert.AreEqual(1, exitCode, "Exit code should be 1 for missing config file");
144-
Assert.IsTrue(output.Contains("Missing configuration file"), "Output should mention missing config file");
145-
Assert.IsTrue(output.Contains("DotnetToolWrapper.json"), "Output should mention config file name");
144+
Assert.Contains("Missing configuration file", output, "Output should mention missing config file");
145+
Assert.Contains("DotnetToolWrapper.json", output, "Output should mention config file name");
146146
}
147147

148148
/// <summary>
@@ -202,7 +202,7 @@ public void TestArgumentPassing()
202202

203203
// Assert
204204
Assert.AreEqual(0, exitCode, "Exit code should be 0");
205-
Assert.IsTrue(output.Contains(testText), $"Output should contain '{testText}'");
205+
Assert.Contains(testText, output, $"Output should contain '{testText}'");
206206
}
207207

208208
/// <summary>
@@ -228,7 +228,7 @@ public void TestUnsupportedTarget()
228228

229229
// Assert
230230
Assert.AreEqual(1, exitCode, "Exit code should be 1 for unsupported target");
231-
Assert.IsTrue(output.Contains("does not support"), "Output should mention unsupported target");
231+
Assert.Contains("does not support", output, "Output should mention unsupported target");
232232
}
233233

234234
/// <summary>
@@ -255,6 +255,6 @@ public void TestBadConfiguration()
255255

256256
// Assert
257257
Assert.AreEqual(1, exitCode, "Exit code should be 1 for bad configuration");
258-
Assert.IsTrue(output.Contains("Bad configuration"), "Output should mention bad configuration");
258+
Assert.Contains("Bad configuration", output, "Output should mention bad configuration");
259259
}
260260
}

test/DemaConsulting.DotnetToolWrapper.Tests/ProgramTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public void TestGetTarget()
5151

5252
// Assert
5353
Assert.IsNotNull(target);
54-
Assert.IsTrue(target.Contains('-'), "Target should contain a hyphen");
54+
Assert.Contains("-", target, "Target should contain a hyphen");
5555

5656
var parts = target.Split('-');
57-
Assert.AreEqual(2, parts.Length, "Target should have exactly two parts");
57+
Assert.HasCount(2, parts, "Target should have exactly two parts");
5858
}
5959
}

0 commit comments

Comments
 (0)