Skip to content
5 changes: 4 additions & 1 deletion src/LCT.Common.UTests/CommonHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,20 @@ public void RemoveMultipleExcludedComponents_ReturnSuccess()
ComponentsForBom.Add(new Component() { Name = "Debian", Version = "3.1.2" });
ComponentsForBom.Add(new Component() { Name = "Newton", Version = "3.1.3" });
ComponentsForBom.Add(new Component() { Name = "Log4t", Version = "3.1.4" });
ComponentsForBom.Add(new Component() { Name = "Log4t", Version = "3.1.5",Purl= "pkg:npm/foobar@12.3.1" });
ComponentsForBom.Add(new Component() { Name = "Log4t", Version = "3.1.5", Purl = "pkg:npm/foobar@12.3.2" });
int noOfExcludedComponents = 0;

List<string> list = new List<string>();
list.Add("Debian:*");
list.Add("Newton:3.1.3");
list.Add("pkg:npm/foobar@12.3.1");

//Act
CommonHelper.RemoveExcludedComponents(ComponentsForBom, list, ref noOfExcludedComponents);

//Assert
Assert.That(noOfExcludedComponents, Is.EqualTo(4), "Returns the count of excluded components");
Assert.That(noOfExcludedComponents, Is.EqualTo(5), "Returns the count of excluded components");

}

Expand Down
4 changes: 2 additions & 2 deletions src/LCT.Common.UTests/FolderActionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public void CopyToTargetDirectory_PassingDirsWithFiles_ReturnSuccess()
{
//Arrange
string sourcePath = $"{Path.GetTempPath()}\\SampleFolder";
Directory.CreateDirectory(sourcePath);
Directory.CreateDirectory(sourcePath +"\\SampleSubFolder");
System.IO.Directory.CreateDirectory(sourcePath);
System.IO.Directory.CreateDirectory(sourcePath +"\\SampleSubFolder");
File.WriteAllText(sourcePath + "\\Sample.txt", "");
string targetPath = $"{Path.GetTempPath()}/targetPath/";
var folderAction = new FolderAction();
Expand Down
Loading
Loading