Icons were added
This commit is contained in:
@@ -25,7 +25,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.CrackCalculatorT
|
||||
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
|
||||
var ndmPrimitives = newSection.SectionRepository.Primitives;
|
||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = CalcTerms.ShortTerm };
|
||||
var ndms = Triangulation.GetNdms(ndmPrimitives, options);
|
||||
var ndms = ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
var calculator = new CrackForceCalculator();
|
||||
calculator.EndTuple = new ForceTuple() { Mx = -50e3d, My = -50e3d, Nz = 0d };
|
||||
calculator.NdmCollection = ndms;
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
{
|
||||
public class RCSectionsTest
|
||||
{
|
||||
[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)]
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062729176929923703d, -0.0029292919541166911d, 0.00035383082501577246d)]
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046857734823565632d, -0.0025101896869558888d, 0.00027185795017719519d)]
|
||||
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00081656737668168479d, -0.00081656737668168414d, 0.00011865117209051567d)]
|
||||
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00081971887286298598d, -0.00081971887286298544d, 0.00011922273439756063d)]
|
||||
[TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00048146233319312662d, -0.00077822315770951882d, 0.00010599549196849429d)]
|
||||
[TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077822315770951947d, -0.00048146233319312478d, 0.00010599549196849413d)]
|
||||
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
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
||||
var primitives = new List<INdmPrimitive>();
|
||||
primitives.AddRange(GetConcreteNdms(width, height));
|
||||
primitives.AddRange(GetReinforcementNdms(width, height, topArea, bottomArea));
|
||||
ndmCollection.AddRange(Triangulation.GetNdms(primitives, options));
|
||||
ndmCollection.AddRange(primitives.SelectMany(x => x.GetNdms(options)));
|
||||
var loaderData = new LoaderOptions
|
||||
{
|
||||
Preconditions = new Preconditions
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.SteelSections
|
||||
var options = new TriangulationOptions { LimiteState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm };
|
||||
var primitive = new RectanglePrimitive { Width = width, Height = height, HeadMaterial = headMaterial, NdmMaxSize = 1, NdmMinDivision = 100 };
|
||||
var primitives = new List<INdmPrimitive>() { primitive};
|
||||
var ndmCollection = Triangulation.GetNdms(primitives, options);
|
||||
var ndmCollection = primitives.SelectMany(x => x.GetNdms(options));
|
||||
var loaderData = new LoaderOptions
|
||||
{
|
||||
Preconditions = new Preconditions
|
||||
@@ -64,7 +64,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.SteelSections
|
||||
var options = new TriangulationOptions { LimiteState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm };
|
||||
var primitive = new CirclePrimitive { Diameter = diameter, HeadMaterial = headMaterial, NdmMaxSize = 1, NdmMinDivision = 100 };
|
||||
var primitives = new List<INdmPrimitive>() { primitive };
|
||||
var ndmCollection = Triangulation.GetNdms(primitives, options);
|
||||
var ndmCollection = primitives.SelectMany(x => x.GetNdms(options));
|
||||
var loaderData = new LoaderOptions
|
||||
{
|
||||
Preconditions = new Preconditions
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
||||
|
||||
namespace StructureHelperTests.UnitTests.Ndms.Cracks
|
||||
{
|
||||
public class CrackWidthLogicTest
|
||||
{
|
||||
[TestCase(1.4d, 0.001d, 0d, 0.3d, 0.00020999999999999998d)]
|
||||
[TestCase(1.4d, 0.001d, 0.001d, 0.3d, 0d)]
|
||||
public void Run_ShouldPass(double termFactor, double rebarStrain, double concreteStrain, double length, double expectedWidth)
|
||||
{
|
||||
//Arrange
|
||||
var logic = new CrackWidthLogicSP63()
|
||||
{
|
||||
TermFactor = termFactor,
|
||||
BondFactor = 0.5d,
|
||||
StressStateFactor = 1d,
|
||||
PsiSFactor = 1d,
|
||||
RebarStrain = rebarStrain,
|
||||
ConcreteStrain = concreteStrain,
|
||||
Length = length
|
||||
};
|
||||
//Act
|
||||
var width = logic.GetCrackWidth();
|
||||
//Assert
|
||||
Assert.AreEqual(expectedWidth, width, 0.000001d);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,19 @@ using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using LoaderCalculator.Logics.Geometry;
|
||||
using StructureHelperCommon.Infrastructures.Settings;
|
||||
using StructureHelper.Models.Materials;
|
||||
using Moq;
|
||||
|
||||
namespace StructureHelperTests.UnitTests.Ndms.Triangulations
|
||||
{
|
||||
public class RectangleTriangulationTest
|
||||
{
|
||||
private Mock<IHeadMaterial> materialMock;
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
materialMock = new Mock<IHeadMaterial>();
|
||||
}
|
||||
//Участок по центру
|
||||
[TestCase(0d, 0d, 1.0d, 1.0d, 0d, 0.02d, 1, 50 * 50, -0.49d, -0.49d)]
|
||||
//Участок со смещением от центра
|
||||
@@ -26,13 +34,20 @@ namespace StructureHelperTests.UnitTests.Ndms.Triangulations
|
||||
public void Run_ShouldPass (double centerX, double centerY, double width, double height, double angle, double ndmMaxSize, int ndmMinDivision, int expectedCount, double expectedFirstCenterX, double expectedFirstCenterY)
|
||||
{
|
||||
//Arrange
|
||||
IMaterial material = new Material();
|
||||
materialMock
|
||||
.Setup(x => x.GetLoaderMaterial(It.IsAny<LimitStates>(), It.IsAny<CalcTerms>()))
|
||||
.Returns(new Material());
|
||||
|
||||
IPoint2D center = new Point2D { X = centerX, Y = centerY };
|
||||
IRectangleShape rectangle = new RectangleShape { Width = width, Height = height, Angle = angle };
|
||||
IRectangleTriangulationLogicOptions options = new RectangleTriangulationLogicOptions(center, rectangle, ndmMaxSize, ndmMinDivision);
|
||||
IRectangleTriangulationLogic logic = new RectangleTriangulationLogic(options);
|
||||
var options = new RectangleTriangulationLogicOptions(center, rectangle, ndmMaxSize, ndmMinDivision)
|
||||
{
|
||||
triangulationOptions = new TriangulationOptions() { LimiteState = LimitStates.ULS, CalcTerm = CalcTerms.ShortTerm },
|
||||
HeadMaterial = materialMock.Object
|
||||
};
|
||||
var logic = new RectangleTriangulationLogic(options);
|
||||
//Act
|
||||
var result = logic.GetNdmCollection(material);
|
||||
var result = logic.GetNdmCollection();
|
||||
//Assert
|
||||
Assert.NotNull(result);
|
||||
Assert.AreEqual(expectedCount, result.Count());
|
||||
@@ -65,8 +80,8 @@ namespace StructureHelperTests.UnitTests.Ndms.Triangulations
|
||||
var area = ndms.Sum(x => x.Area);
|
||||
var moments = GeometryOperations.GetReducedMomentsOfInertia(ndms);
|
||||
Assert.AreEqual(expectedArea, area, 0.001d);
|
||||
Assert.AreEqual(expectedMomX, moments.MomentX, 0.001d);
|
||||
Assert.AreEqual(expectedMomY, moments.MomentY, 1d);
|
||||
Assert.AreEqual(expectedMomX, moments.EIx, 0.001d);
|
||||
Assert.AreEqual(expectedMomY, moments.EIy, 1d);
|
||||
}
|
||||
[TestCase(0d, 0d, 1.0d, 1.0d, true, 1d, 3020017308.3574591d, 3020017308.3574591d)]
|
||||
[TestCase(0d, 0d, 1.0d, 1.0d, false, 0.92839999999991407d, 3005633713.5049105d, 3005633713.5049105d)]
|
||||
@@ -96,8 +111,8 @@ namespace StructureHelperTests.UnitTests.Ndms.Triangulations
|
||||
var area = ndms.Sum(x => x.Area);
|
||||
var moments = GeometryOperations.GetReducedMomentsOfInertia(ndms);
|
||||
Assert.AreEqual(expectedArea, area, 0.001d);
|
||||
Assert.AreEqual(expectedMomX, moments.MomentX, 0.001d);
|
||||
Assert.AreEqual(expectedMomY, moments.MomentY, 1d);
|
||||
Assert.AreEqual(expectedMomX, moments.EIx, 0.001d);
|
||||
Assert.AreEqual(expectedMomY, moments.EIy, 1d);
|
||||
}
|
||||
[TestCase(0d, 0d, 1.0d, true, 0.78079430967489682d, 1777730450.3666615d, 1776732530.5957441d)]
|
||||
[TestCase(0d, 0d, 1.0d, false, 0.72079430967490343d, 1770498845.4396176d, 1760438764.1059904d)]
|
||||
@@ -128,8 +143,8 @@ namespace StructureHelperTests.UnitTests.Ndms.Triangulations
|
||||
var area = ndms.Sum(x => x.Area);
|
||||
var moments = GeometryOperations.GetReducedMomentsOfInertia(ndms);
|
||||
Assert.AreEqual(expectedArea, area, 0.001d);
|
||||
Assert.AreEqual(expectedMomX, moments.MomentX, 0.001d);
|
||||
Assert.AreEqual(expectedMomY, moments.MomentY, 1d);
|
||||
Assert.AreEqual(expectedMomX, moments.EIx, 0.001d);
|
||||
Assert.AreEqual(expectedMomY, moments.EIy, 1d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user