Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"msbuild-sdks": {
"MSTest.Sdk": "3.9.1"
"MSTest.Sdk": "3.11.1"
}
}
4 changes: 2 additions & 2 deletions src/Common.Tests/Hashing/DirectoryFileHasherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DirectoryFileHasherTests
public TestContext TestContext { get; set; }
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

[DataTestMethod]
[TestMethod]
[DataRow(@"X:\Dir\Foo\1.0.0\lib\Foo.dll", true)]
[DataRow(@"x:\dIR\Foo\1.0.0\lib\Foo.dll", true)]
[DataRow(@"x:\OtherDir\foo.txt", false)]
Expand All @@ -30,7 +30,7 @@ public void ContainsPath(string path, bool expectedResult)
Assert.AreEqual(expectedResult, hasher.ContainsPath(path));
}

[DataTestMethod]
[TestMethod]
[DataRow(@"Dir\Foo\1.0.0\lib\Foo.dll", true)]
[DataRow(@"dIR\Foo\2.0.0\lib\Foo.dll", true)]
[DataRow(@"OtherDir\foo.txt", false)]
Expand Down
2 changes: 1 addition & 1 deletion src/Common.Tests/Hashing/OutputHasherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task ComputeHashFileNotFound()
string file = Path.Combine(dir, "file.txt");

// Ensure exceptions are propagated correctly.
await Assert.ThrowsExceptionAsync<FileNotFoundException>(async () => await hasher.ComputeHashAsync(file, CancellationToken.None));
await Assert.ThrowsExactlyAsync<FileNotFoundException>(async () => await hasher.ComputeHashAsync(file, CancellationToken.None));
}

[TestMethod]
Expand Down
6 changes: 3 additions & 3 deletions src/Common.Tests/HexUtilitiesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.MSBuildCache.Tests;
[TestClass]
public class HexUtilitiesTests
{
[DataTestMethod]
[TestMethod]
[DataRow("0123456789ABCDEFabcdef", new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF, })]
[DataRow("", null)]
[DataRow(null, null)]
Expand All @@ -29,12 +29,12 @@ public void HexToBytes(string hex, byte[]? expectedBytes)
Assert.AreEqual(expectedBytes.Length, bytes.Length);
for (int i = 0; i < expectedBytes.Length; i++)
{
Assert.AreEqual(expectedBytes[i], bytes[i], "Index {0}", i);
Assert.AreEqual(expectedBytes[i], bytes[i], $"Index {i}");
}
}

[TestMethod]
public void HexToBytesOddChars() => Assert.ThrowsException<ArgumentException>(() => HexUtilities.HexToBytes("fAbCd"));
public void HexToBytesOddChars() => Assert.ThrowsExactly<ArgumentException>(() => HexUtilities.HexToBytes("fAbCd"));

[TestMethod]
public void HexToBytesBadChars()
Expand Down
4 changes: 2 additions & 2 deletions src/Common.Tests/PathHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.MSBuildCache.Tests;
[TestClass]
public class PathHelperTests
{
[DataTestMethod]
[TestMethod]
[DataRow(@"X:\A\B\C", @"X:\A", @"B\C")]
// Lots of .. and .
[DataRow(@"X:\Z\..\A\B\.\C", @"X:\Y\..\D\..\A\.\.", @"B\C")]
Expand All @@ -27,7 +27,7 @@ public class PathHelperTests
public void MakePathRelative(string path, string basePath, string? expectedResult)
=> Assert.AreEqual(expectedResult, path.MakePathRelativeTo(basePath));

[DataTestMethod]
[TestMethod]
[DataRow(@"X:\A\B\C\file.txt", @"X:\A", true)]
// Lots of .. and .
[DataRow(@"X:\Z\..\A\B\.\C\file.txt", @"X:\Y\..\D\..\A\.\.", true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Repack.Tests/RepackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.MSBuildCache.Repack.Tests;
[TestClass]
public class RepackTests
{
[DataTestMethod]
[TestMethod]
[DataRow(typeof(MSBuildCacheAzureBlobStoragePlugin))]
[DataRow(typeof(MSBuildCacheAzurePipelinesPlugin))]
[DataRow(typeof(MSBuildCacheLocalPlugin))]
Expand Down
Loading