Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

using StabilityMatrix.Core.Helper.Factory;
using StabilityMatrix.Core.Models.Packages;
1 year ago
namespace StabilityMatrix.Tests.Helper;
[TestClass]
public class PackageFactoryTests
{
private PackageFactory packageFactory = null!;
private IEnumerable<BasePackage> fakeBasePackages = null!;
9 months ago
1 year ago
[TestInitialize]
public void Setup()
{
9 months ago
fakeBasePackages = new List<BasePackage> { new DankDiffusion(null!, null!, null!, null!) };
packageFactory = new PackageFactory(fakeBasePackages, null, null, null, null, null);
1 year ago
}
9 months ago
1 year ago
[TestMethod]
public void GetAllAvailablePackages_ReturnsAllPackages()
{
var result = packageFactory.GetAllAvailablePackages();
Assert.AreEqual(1, result.Count());
}
9 months ago
1 year ago
[TestMethod]
public void FindPackageByName_ReturnsPackage()
{
var result = packageFactory.FindPackageByName("dank-diffusion");
Assert.IsNotNull(result);
}
9 months ago
1 year ago
[TestMethod]
public void FindPackageByName_ReturnsNull()
{
var result = packageFactory.FindPackageByName("not-a-package");
Assert.IsNull(result);
}
}