Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/DemaConsulting.DotnetToolWrapper.Tests/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

// Disable test parallelization to avoid race conditions with shared config files
[assembly: DoNotParallelize]
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.101">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.7.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.17.0.131074">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
10 changes: 5 additions & 5 deletions test/DemaConsulting.DotnetToolWrapper.Tests/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public void TestMissingConfigFile()

// Assert
Assert.AreEqual(1, exitCode, "Exit code should be 1 for missing config file");
Assert.IsTrue(output.Contains("Missing configuration file"), "Output should mention missing config file");
Assert.IsTrue(output.Contains("DotnetToolWrapper.json"), "Output should mention config file name");
Assert.Contains("Missing configuration file", output, "Output should mention missing config file");
Assert.Contains("DotnetToolWrapper.json", output, "Output should mention config file name");
}

/// <summary>
Expand Down Expand Up @@ -202,7 +202,7 @@ public void TestArgumentPassing()

// Assert
Assert.AreEqual(0, exitCode, "Exit code should be 0");
Assert.IsTrue(output.Contains(testText), $"Output should contain '{testText}'");
Assert.Contains(testText, output, $"Output should contain '{testText}'");
}

/// <summary>
Expand All @@ -228,7 +228,7 @@ public void TestUnsupportedTarget()

// Assert
Assert.AreEqual(1, exitCode, "Exit code should be 1 for unsupported target");
Assert.IsTrue(output.Contains("does not support"), "Output should mention unsupported target");
Assert.Contains("does not support", output, "Output should mention unsupported target");
}

/// <summary>
Expand All @@ -255,6 +255,6 @@ public void TestBadConfiguration()

// Assert
Assert.AreEqual(1, exitCode, "Exit code should be 1 for bad configuration");
Assert.IsTrue(output.Contains("Bad configuration"), "Output should mention bad configuration");
Assert.Contains("Bad configuration", output, "Output should mention bad configuration");
}
}
4 changes: 2 additions & 2 deletions test/DemaConsulting.DotnetToolWrapper.Tests/ProgramTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public void TestGetTarget()

// Assert
Assert.IsNotNull(target);
Assert.IsTrue(target.Contains('-'), "Target should contain a hyphen");
Assert.Contains("-", target, "Target should contain a hyphen");

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