ConcreteBucklingCalculator was added
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using LoaderCalculator.Tests.Infrastructures.Logics;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
||||
using StructureHelperLogics.Models.Templates.RCs;
|
||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
||||
using StructureHelperLogics.NdmCalculations.Buckling;
|
||||
|
||||
namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
||||
{
|
||||
public class BucklingLogicTest
|
||||
{
|
||||
[TestCase(0d, 0d, 0d, 0d, 0d, -100d, -0.15d, 0.15d, 1d)]
|
||||
[TestCase(0d, 0d, -50d, 0d, 0d, -100d, -0.15d, 0.15d, 1.5d)]
|
||||
[TestCase(0d, 0d, -100d, 0d, 0d, -100d, -0.15d, 0.15d, 2d)]
|
||||
[TestCase(0d, 0d, 0d, -10d, 0d, -100d, -0.15d, 0.15d, 1d)]
|
||||
[TestCase(-5d, 0d, -50d, -10d, 0d, -100d, -0.15d, 0.15d, 1.5d)]
|
||||
[TestCase(-10d, 0d, -100d, -10d, 0d, -100d, -0.15d, 0.15d, 2d)]
|
||||
[TestCase(0d, 0d, 0d, -10d, 10d, -100d, -0.15d, 0.15d, 1d)]
|
||||
[TestCase(-5d, 5d, -50d, -10d, 10d, -100d, -0.15d, 0.15d, 1.5d)]
|
||||
[TestCase(-10d, 10d, -100d, -10d, 10d, -100d, -0.15d, 0.15d, 2d)]
|
||||
public void Run_ShoulPass_PhiLogicSP63(double longMx, double longMy, double longNz, double shortMx, double shortMy, double shortNz, double pointX, double pointY, double expectedPhi)
|
||||
{
|
||||
//Arrange
|
||||
var fullTuple = new ForceTuple() { Mx = shortMx, My = shortMy, Nz = shortNz };
|
||||
var longTuple = new ForceTuple() { Mx = longMx, My = longMy, Nz = longNz };
|
||||
var point = new Point2D() { X = pointX, Y = pointY };
|
||||
//Act
|
||||
var phiLogic = new PhiLogicSP63(fullTuple, longTuple, point);
|
||||
var phiL = phiLogic.GetPhil();
|
||||
//Assert
|
||||
Assert.AreEqual(expectedPhi, phiL, 0.01d);
|
||||
}
|
||||
|
||||
[TestCase(0d, 0.5d, 0.15d)]
|
||||
[TestCase(0.1d, 0.5d, 0.2d)]
|
||||
[TestCase(1d, 0.5d, 1.5d)]
|
||||
public void Run_ShoulPass_DeltaELogicSP63(double eccentricity, double size, double expectedDeltaE)
|
||||
{
|
||||
//Arrange
|
||||
//Act
|
||||
var deltaELogic = new DeltaELogicSP63(eccentricity, size);
|
||||
var deltaE = deltaELogic.GetDeltaE();
|
||||
//Assert
|
||||
Assert.AreEqual(expectedDeltaE, deltaE, 0.01d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props')" />
|
||||
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
|
||||
<Import Project="..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -44,6 +44,7 @@
|
||||
<Compile Include="FieldsVisualizerTests\WindowTests\ViewerTest.cs" />
|
||||
<Compile Include="FunctionalTests\Ndms\Calculators\ForceCalculatorTests\RCSectionsTest.cs" />
|
||||
<Compile Include="FunctionalTests\Ndms\RCSections\RCSectionTest.cs" />
|
||||
<Compile Include="FunctionalTests\Ndms\RCSections\BucklingLogicTest.cs" />
|
||||
<Compile Include="FunctionalTests\Ndms\SteelSections\ReinforcementTest.cs" />
|
||||
<Compile Include="Infrastructures\Logics\ExpectedProcessor.cs" />
|
||||
<Compile Include="LibrariesTests\Ndms\RCSections\RCSectionTest.cs" />
|
||||
@@ -58,16 +59,14 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Castle.Core.5.1.1\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LoaderCalculator">
|
||||
<HintPath>..\Libraries\LoaderCalculator.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.18.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.18.2\lib\net462\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Moq.4.18.4\lib\net462\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
|
||||
@@ -112,7 +111,7 @@
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
|
||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.2.1\build\net35\NUnit3TestAdapter.props'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -8,7 +8,19 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="5.1.0" targetFramework="net472" />
|
||||
<package id="Moq" version="4.18.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="5.1.1" targetFramework="net472" />
|
||||
<package id="Moq" version="4.18.4" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.13.3" targetFramework="net472" />
|
||||
<package id="NUnit3TestAdapter" version="4.2.1" targetFramework="net472" />
|
||||
<package id="NUnit3TestAdapter" version="4.3.1" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user