Trace logger calls were adde in limit curve calculator
This commit is contained in:
@@ -16,6 +16,7 @@ namespace StructureHelperTests.UnitTests.Calcuators
|
||||
var calculator = new LimitCurveCalculator(new StabLimitCurveLogic())
|
||||
{
|
||||
};
|
||||
calculator.PointCount = 12;
|
||||
calculator.SurroundData.XMax = xmax;
|
||||
calculator.SurroundData.XMin = -xmax;
|
||||
calculator.SurroundData.YMax = ymax;
|
||||
|
||||
@@ -14,9 +14,6 @@ namespace StructureHelperTests.UnitTests.Calcuators
|
||||
public void GetPoints_ValidPoints_ReturnsTransformedPoints()
|
||||
{
|
||||
// Arrange
|
||||
var parameterLogicMock = new Mock<ILimitCurveParameterLogic>();
|
||||
parameterLogicMock.Setup(p => p.GetParameter()).Returns(2.0); // Mocking the GetParameter method
|
||||
|
||||
var getPredicateLogic = new Mock<IGetPredicateLogic>();
|
||||
getPredicateLogic.Setup(p => p.GetPredicate()).Returns(point => point.X >= 0.5d);//
|
||||
|
||||
@@ -39,34 +36,9 @@ namespace StructureHelperTests.UnitTests.Calcuators
|
||||
|
||||
for (int i = 0; i < inputPoints.Count; i++)
|
||||
{
|
||||
Assert.AreEqual(inputPoints[i].X * 0.5, result[i].X);
|
||||
Assert.AreEqual(inputPoints[i].Y * 0.5, result[i].Y);
|
||||
Assert.AreEqual(0.5d, result[i].X, 0.01d);
|
||||
Assert.AreEqual(inputPoints[i].Y / inputPoints[i].X * 0.5d, result[i].Y, 0.01d);
|
||||
}
|
||||
|
||||
// Verify that GetParameter was called
|
||||
parameterLogicMock.Verify(p => p.GetParameter(), Times.Exactly(inputPoints.Count));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetPoints_InvalidPredicate_ThrowsException()
|
||||
{
|
||||
// Arrange
|
||||
var parameterLogicMock = new Mock<ILimitCurveParameterLogic>();
|
||||
parameterLogicMock.Setup(p => p.GetParameter()).Returns(2.0);
|
||||
|
||||
var getPredicateLogic = new Mock<IGetPredicateLogic>();
|
||||
getPredicateLogic.Setup(p => p.GetPredicate()).Returns(point => point.X >= 0.5d);//
|
||||
|
||||
var limitCurveLogic = new LimitCurveLogic(getPredicateLogic.Object);
|
||||
|
||||
var inputPoints = new List<IPoint2D>
|
||||
{
|
||||
new Point2D { X = 1, Y = 2 },
|
||||
new Point2D { X = 3, Y = 4 }
|
||||
};
|
||||
|
||||
// Act & Assert
|
||||
Assert.Throws<StructureHelperException>(() => limitCurveLogic.GetPoints(inputPoints));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user