Browse Source

Add GetSubPath tests

pull/5/head^2
Ionite 1 year ago
parent
commit
62b7b3bae9
No known key found for this signature in database
  1. 18
      StabilityMatrix.Tests/Models/InstalledPackageTests.cs

18
StabilityMatrix.Tests/Models/InstalledPackageTests.cs

@ -0,0 +1,18 @@
using StabilityMatrix.Models;
namespace StabilityMatrix.Tests.Models;
[TestClass]
public class InstalledPackageTests
{
[DataTestMethod]
[DataRow("C:\\User\\AppData\\StabilityMatrix", "C:\\User\\Other", null)]
[DataRow("C:\\Data", "D:\\Data\\abc", null)]
[DataRow("C:\\Data", "C:\\Data\\abc", "abc")]
[DataRow("C:\\User\\AppData\\StabilityMatrix", "C:\\User\\AppData\\StabilityMatrix\\Packages\\abc", "Packages\\abc")]
public void TestGetSubPath(string relativeTo, string path, string? expected)
{
var result = InstalledPackage.GetSubPath(relativeTo, path);
Assert.AreEqual(expected, result);
}
}
Loading…
Cancel
Save