|
|
|
@ -8,31 +8,28 @@ public class PackageFactoryTests
|
|
|
|
|
{ |
|
|
|
|
private PackageFactory packageFactory = null!; |
|
|
|
|
private IEnumerable<BasePackage> fakeBasePackages = null!; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestInitialize] |
|
|
|
|
public void Setup() |
|
|
|
|
{ |
|
|
|
|
fakeBasePackages = new List<BasePackage> |
|
|
|
|
{ |
|
|
|
|
new DankDiffusion(null!, null!, null!, null!) |
|
|
|
|
}; |
|
|
|
|
packageFactory = new PackageFactory(fakeBasePackages); |
|
|
|
|
fakeBasePackages = new List<BasePackage> { new DankDiffusion(null!, null!, null!, null!) }; |
|
|
|
|
packageFactory = new PackageFactory(fakeBasePackages, null, null, null, null, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
|
public void GetAllAvailablePackages_ReturnsAllPackages() |
|
|
|
|
{ |
|
|
|
|
var result = packageFactory.GetAllAvailablePackages(); |
|
|
|
|
Assert.AreEqual(1, result.Count()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
|
public void FindPackageByName_ReturnsPackage() |
|
|
|
|
{ |
|
|
|
|
var result = packageFactory.FindPackageByName("dank-diffusion"); |
|
|
|
|
Assert.IsNotNull(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[TestMethod] |
|
|
|
|
public void FindPackageByName_ReturnsNull() |
|
|
|
|
{ |
|
|
|
|