ConcreteBucklingCalculator was added

This commit is contained in:
Evgeny Redikultsev
2023-01-29 20:45:42 +05:00
parent 6d1f9bae1b
commit f013ddae13
44 changed files with 924 additions and 86 deletions

View File

@@ -1,4 +1,5 @@
using LoaderCalculator.Tests.Infrastructures.Logics;
using Moq;
using NUnit.Framework;
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
using StructureHelperLogics.Models.Templates.RCs;
@@ -8,15 +9,19 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
{
public class RCSectionsTest
{
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, -0.00062544561815463693d, -0.0029292919541166911d, 0.00035383082501577246d)]
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, -0.00046762265275279838d, -0.0025101896869558888d, 0.00027185795017719519d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, -0.00080914991212906239d, -0.00080914991212906184d, 0.00011900072665826425d)]
public void Run_SouldPass(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, double expectedKx, double expectedKy, double expectedEpsZ)
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062544561815463693d, -0.0029292919541166911d, 0.00035383082501577246d)]
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046762265275279838d, -0.0025101896869558888d, 0.00027185795017719519d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00080914991212906239d, -0.00080914991212906184d, 0.00011900072665826425d)]
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.0008126213321004612d, -0.00081262133210046055d, 0.00011963568117586145d)]
[TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00047720148631058529d, -0.00077269031816753532d, 0.00010610472872420363d)]
[TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077269031816753478d, -0.00047720148631058437d, 0.00010610472872420363d)]
public void Run_ShouldPass(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, bool isBuckling, double expectedKx, double expectedKy, double expectedEpsZ)
{
//Arrange
var template = new RectangleBeamTemplate(width, height) { TopDiameter = topDiametr, BottomDiameter = bottomDiametr, WidthCount = widthCount, HeightCount = heightCount};
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
var calculator = newSection.SectionRepository.CalculatorsList[0];
var calculator = newSection.SectionRepository.CalculatorsList[0] as IForceCalculator;
calculator.CompressedMember.Buckling = isBuckling;
//Act
calculator.Run();
var result = calculator.Result as IForcesResults;
@@ -32,15 +37,16 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
Assert.AreEqual(expectedEpsZ, epsz, ExpectedProcessor.GetAccuracyForExpectedValue(expectedEpsZ));
}
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, true, true)]
[TestCase(1d, 0.2d, 0.012d, 0.012d, 5, 2, true, false)]
[TestCase(1d, 0.2d, 0.012d, 0.025d, 5, 2, true, true)]
public void Run_SouldPass_Result_IsNotValid(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, bool calcResult, bool firstForceResult)
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, true, true)]
[TestCase(1d, 0.2d, 0.012d, 0.012d, 5, 2, false, true, false)]
[TestCase(1d, 0.2d, 0.012d, 0.025d, 5, 2, false, true, true)]
public void Run_ShouldPass_Result_IsNotValid(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount,bool isBuckling, bool calcResult, bool firstForceResult)
{
//Arrange
var template = new RectangleBeamTemplate(width, height) { TopDiameter = topDiametr, BottomDiameter = bottomDiametr, WidthCount = widthCount, HeightCount = heightCount };
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
var calculator = newSection.SectionRepository.CalculatorsList[0];
var calculator = newSection.SectionRepository.CalculatorsList[0] as IForceCalculator;
calculator.CompressedMember.Buckling = isBuckling;
//Act
calculator.Run();
var result = calculator.Result as IForcesResults;