public void TestCreateForULineFromRectangle_Position3() { int position = 3; List <Point3d> actualPoints = RebarPoints.CreateForLineFromRectangle(_rectangle, position, _coverDimensions, _props); List <Point3d> expectedPoints = new List <Point3d> { new Point3d(0.021, 0.03, 0), new Point3d(0.021, 0.375, 0) }; Assert.Equal(expectedPoints.Count, actualPoints.Count); for (int i = 0; i < actualPoints.Count; i++) { Assert.Equal(expectedPoints[i].X, actualPoints[i].X, 4); Assert.Equal(expectedPoints[i].Y, actualPoints[i].Y, 4); Assert.Equal(expectedPoints[i].Z, actualPoints[i].Z, 4); } }
public void TestCreateForLBarShape() { List <Point3d> actualPoints = RebarPoints.CreateForLBarShape(0.500, 0.300, _props); List <Point3d> expectedPoints = new List <Point3d> { new Point3d(0, 0.006, 0), new Point3d(0.294, 0.006, 0), new Point3d(0.294, 0.5, 0) }; Assert.Equal(expectedPoints.Count, actualPoints.Count); for (int i = 0; i < actualPoints.Count; i++) { Assert.Equal(expectedPoints[i].X, actualPoints[i].X, 4); Assert.Equal(expectedPoints[i].Y, actualPoints[i].Y, 4); Assert.Equal(expectedPoints[i].Z, actualPoints[i].Z, 4); } }
public void TestCreateForUBarFromRectangle_Position1() { int position = 1; List <Point3d> actualPoints = RebarPoints.CreateForUBarFromRectangle(_rectangle, position, _coverDimensions, 0.100, _props); List <Point3d> expectedPoints = new List <Point3d> { new Point3d(0.38, 0.036, 0), new Point3d(0.474, 0.036, 0), new Point3d(0.474, 0.369, 0), new Point3d(0.38, 0.369, 0) }; Assert.Equal(expectedPoints.Count, actualPoints.Count); for (int i = 0; i < actualPoints.Count; i++) { Assert.Equal(expectedPoints[i].X, actualPoints[i].X, 4); Assert.Equal(expectedPoints[i].Y, actualPoints[i].Y, 4); Assert.Equal(expectedPoints[i].Z, actualPoints[i].Z, 4); } }
public void TestCreateStirrupFromRectangleShape_HookType1() { int hookType = 1; List <Point3d> actualPoints = RebarPoints.CreateStirrupFromRectangleShape(_rectangle, hookType, _bendingRoller, _coverDimensions, 0.100, _props); List <Point3d> expectedPoints = new List <Point3d> { new Point3d(0.1235, 0.3174, -0.006), new Point3d(0.021, 0.4199, -0.006), new Point3d(0.021, 0.036, -0.006), new Point3d(0.474, 0.036, -0.006), new Point3d(0.474, 0.369, 0.006), new Point3d(-0.0299, 0.369, 0.006), new Point3d(0.0726, 0.2665, 0.006) }; Assert.Equal(expectedPoints.Count, actualPoints.Count); for (int i = 0; i < actualPoints.Count; i++) { Assert.Equal(expectedPoints[i].X, actualPoints[i].X, 4); Assert.Equal(expectedPoints[i].Y, actualPoints[i].Y, 4); Assert.Equal(expectedPoints[i].Z, actualPoints[i].Z, 4); } }
public void CheckExceptions_CreateForULineFromRectangle_Position4() { var exception = Assert.Throws <ArgumentException>(() => RebarPoints.CreateForLineFromRectangle(_rectangle, 4, _coverDimensions, _props)); Assert.Equal("Position should be between 0 and 3", exception.Message); }
public void CheckExceptions_CreateForLBarShape_Width0() { var exception = Assert.Throws <ArgumentException>(() => RebarPoints.CreateForLBarShape(0.500, 0, _props)); Assert.Equal("Input dimensions should be > 0", exception.Message); }
public void CheckExceptions_CreateForSpacerShape_Height0() { var exception = Assert.Throws <ArgumentException>(() => RebarPoints.CreateForSpacerShape(0, 0.300, 0.400, _props)); Assert.Equal("Input dimensions should be > 0", exception.Message); }
public void CheckExceptions_CreateStirrupFromRectangleShape_Hook0() { var exception = Assert.Throws <ArgumentException>(() => RebarPoints.CreateStirrupFromRectangleShape(_rectangle, 1, _bendingRoller, _coverDimensions, 0, _props)); Assert.Equal("Hook Length should be > 0", exception.Message); }
public void CheckExceptions_CreateStirrupFromRectangleShape_HookType2() { var exception = Assert.Throws <ArgumentException>(() => RebarPoints.CreateStirrupFromRectangleShape(_rectangle, 2, _bendingRoller, _coverDimensions, 0.100, _props)); Assert.Equal("Hooks Type should be between 0 and 1", exception.Message); }
public void CheckExceptions_CreateForUBarFromRectangle_Hook0() { var exception = Assert.Throws <ArgumentException>(() => RebarPoints.CreateForUBarFromRectangle(_rectangle, 3, _coverDimensions, 0, _props)); Assert.Equal("Hook Length should be > 0", exception.Message); }