Skip to content

Commit

Permalink
unit test cases fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ragavareddychalapala committed Aug 5, 2024
1 parent e51f919 commit 93b83b4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
26 changes: 13 additions & 13 deletions src/LCT.Common.UTests/CommonHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ namespace LCT.Common.UTest
{
public class CommonHelperTest
{
[Test]
[Ignore("Reason for envirnment exit code is 2")]
public void WriteComponentsNotLinkedListInConsole_PassingList_ReturnSuccess()
{
//Arrange
List<Components> ComponentsNotLinked = new List<Components>();
ComponentsNotLinked.Add(new Components());
//This test case ignore due to environment exit comes in the method
//[Test]
//public void WriteComponentsNotLinkedListInConsole_PassingList_ReturnSuccess()
//{
// //Arrange
// List<Components> ComponentsNotLinked = new List<Components>();
// ComponentsNotLinked.Add(new Components());

//Act
CommonHelper.WriteComponentsNotLinkedListInConsole(ComponentsNotLinked);
//Assert
Assert.IsTrue(true);
}
// //Act
// CommonHelper.WriteComponentsNotLinkedListInConsole(ComponentsNotLinked);

// //Assert
// Assert.IsTrue(true);
//}

[Test]
public void RemoveExcludedComponents_PassingList_ReturnSuccess()
Expand Down
31 changes: 16 additions & 15 deletions src/LCT.Common.UTests/FileOperationsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,23 @@ public void CombineComponentsFromExistingBOM_WhenFilepathIsWrong_ReturnsSuccess(
Assert.AreEqual(1, comparisonData.Components.Count);
}

[Test]
[Ignore("Reason for envirnment exit code -1")]
public void CombineComponentsFromExistingBOM_WhenFilepathIsWrong_ReturnsFailure()
{
//Arrange
Bom bom = new Bom();
string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
string outFolder = Path.GetDirectoryName(exePath);
string filePath = outFolder + @"\LCT.Common.UTests\Source";
var fileOperations = new FileOperations();

//Act
Bom comparisonData = fileOperations.CombineComponentsFromExistingBOM(bom, filePath);
//This test case ignore due to environment exit comes in the method
//[Test]
//public void CombineComponentsFromExistingBOM_WhenFilepathIsWrong_ReturnsFailure()
//{
// //Arrange
// Bom bom = new Bom();
// string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
// string outFolder = Path.GetDirectoryName(exePath);
// string filePath = outFolder + @"\LCT.Common.UTests\Source";
// var fileOperations = new FileOperations();

//Assert
Assert.AreEqual(null, comparisonData.Components);
}
// //Act
// Bom comparisonData = fileOperations.CombineComponentsFromExistingBOM(bom, filePath);

// //Assert
// Assert.AreEqual(null, comparisonData.Components);
//}
}
}

0 comments on commit 93b83b4

Please sign in to comment.