Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdSecGH-81 test coverage helpers batch 5 #115

Merged
merged 11 commits into from
Feb 5, 2025
10 changes: 5 additions & 5 deletions AdSecGH/Components/2_Rebar/CreateRebarGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,28 +165,28 @@
// top
if (Params.Input[0].SourceCount != 0) {
var grp = ITemplateGroup.Create(ITemplateGroup.Face.Top);
grp.Layers = AdSecInput.ILayers(this, da, 0);
grp.Layers = this.GetILayers(da, 0);

Check warning on line 168 in AdSecGH/Components/2_Rebar/CreateRebarGroup.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarGroup.cs#L168

Added line #L168 was not covered by tests
groups.Add(new AdSecRebarGroupGoo(grp));
}

// left
if (Params.Input[1].SourceCount != 0) {
var grp = ITemplateGroup.Create(ITemplateGroup.Face.LeftSide);
grp.Layers = AdSecInput.ILayers(this, da, 1);
grp.Layers = this.GetILayers(da, 1);

Check warning on line 175 in AdSecGH/Components/2_Rebar/CreateRebarGroup.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarGroup.cs#L175

Added line #L175 was not covered by tests
groups.Add(new AdSecRebarGroupGoo(grp));
}

// right
if (Params.Input[2].SourceCount != 0) {
var grp = ITemplateGroup.Create(ITemplateGroup.Face.RightSide);
grp.Layers = AdSecInput.ILayers(this, da, 2);
grp.Layers = this.GetILayers(da, 2);

Check warning on line 182 in AdSecGH/Components/2_Rebar/CreateRebarGroup.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarGroup.cs#L182

Added line #L182 was not covered by tests
groups.Add(new AdSecRebarGroupGoo(grp));
}

// bottom
if (Params.Input[3].SourceCount != 0) {
var grp = ITemplateGroup.Create(ITemplateGroup.Face.Bottom);
grp.Layers = AdSecInput.ILayers(this, da, 3);
grp.Layers = this.GetILayers(da, 3);

Check warning on line 189 in AdSecGH/Components/2_Rebar/CreateRebarGroup.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarGroup.cs#L189

Added line #L189 was not covered by tests
groups.Add(new AdSecRebarGroupGoo(grp));
}

Expand All @@ -203,7 +203,7 @@
// top
if (Params.Input[0].SourceCount != 0) {
var grp = IPerimeterGroup.Create();
grp.Layers = AdSecInput.ILayers(this, da, 0);
grp.Layers = this.GetILayers(da, 0);

Check warning on line 206 in AdSecGH/Components/2_Rebar/CreateRebarGroup.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarGroup.cs#L206

Added line #L206 was not covered by tests
groups.Add(new AdSecRebarGroupGoo(grp));
}

Expand Down
14 changes: 5 additions & 9 deletions AdSecGH/Components/2_Rebar/CreateRebarLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,31 +216,27 @@
switch (_mode) {
case FoldMode.Line:
// create line group
group = new AdSecRebarGroupGoo(ILineGroup.Create(AdSecInput.IPoint(this, da, 1),
AdSecInput.IPoint(this, da, 2), rebarLayerValue));
group = new AdSecRebarGroupGoo(ILineGroup.Create(this.GetAdSecPointGoo(da, 1).AdSecPoint,
this.GetAdSecPointGoo(da, 2).AdSecPoint, rebarLayerValue));

Check warning on line 220 in AdSecGH/Components/2_Rebar/CreateRebarLayout.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarLayout.cs#L219-L220

Added lines #L219 - L220 were not covered by tests
break;

case FoldMode.Circle:
// create circle rebar group
group = new AdSecRebarGroupGoo(ICircleGroup.Create(AdSecInput.IPoint(this, da, 1, true),
group = new AdSecRebarGroupGoo(ICircleGroup.Create(this.GetAdSecPointGoo(da, 1, true).AdSecPoint,

Check warning on line 224 in AdSecGH/Components/2_Rebar/CreateRebarLayout.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarLayout.cs#L224

Added line #L224 was not covered by tests
(Length)Input.UnitNumber(this, da, 2, _lengthUnit), (Angle)Input.UnitNumber(this, da, 3, _angleUnit, true),
rebarLayerValue));
break;

case FoldMode.Arc:
// create arc rebar grouup
group = new AdSecRebarGroupGoo(IArcGroup.Create(AdSecInput.IPoint(this, da, 1, true),
group = new AdSecRebarGroupGoo(IArcGroup.Create(this.GetAdSecPointGoo(da, 1, true).AdSecPoint,

Check warning on line 230 in AdSecGH/Components/2_Rebar/CreateRebarLayout.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/2_Rebar/CreateRebarLayout.cs#L230

Added line #L230 was not covered by tests
(Length)Input.UnitNumber(this, da, 2, _lengthUnit), (Angle)Input.UnitNumber(this, da, 3, _angleUnit),
(Angle)Input.UnitNumber(this, da, 4, _angleUnit), rebarLayerValue));
break;

case FoldMode.SingleBars:
// create single rebar group
var bars = ISingleBars.Create(this.GetAdSecRebarBundleGoo(da, 0).Value);

bars.Positions = AdSecInput.IPoints(this, da, 1);

group = new AdSecRebarGroupGoo(bars);

break;
}

Expand Down
2 changes: 1 addition & 1 deletion AdSecGH/Components/3_Section/CreateSubComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected override void SolveInstance(IGH_DataAccess DA) {
return;
}

var offset = AdSecInput.IPoint(this, DA, 1, true) ?? IPoint.Create(Length.Zero, Length.Zero);
var offset = this.GetAdSecPointGoo(DA, 1, true).AdSecPoint ?? IPoint.Create(Length.Zero, Length.Zero);
var subComponent = ISubComponent.Create(section.Section, offset);
var subGoo = new AdSecSubComponentGoo(subComponent, section.LocalPlane, section.DesignCode, section._codeName,
section._materialName);
Expand Down
5 changes: 3 additions & 2 deletions AdSecGH/Components/6_Results/ConcreteStressStrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@
return;
}

var point = this.GetAdSecPointGoo(DA, 2).AdSecPoint;

Check warning on line 87 in AdSecGH/Components/6_Results/ConcreteStressStrain.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/6_Results/ConcreteStressStrain.cs#L87

Added line #L87 was not covered by tests
// ULS strain
var strainULS = uls.Deformation.StrainAt(AdSecInput.IPoint(this, DA, 2));
var strainULS = uls.Deformation.StrainAt(point);

Check warning on line 89 in AdSecGH/Components/6_Results/ConcreteStressStrain.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/6_Results/ConcreteStressStrain.cs#L89

Added line #L89 was not covered by tests
var outStrainULS = new GH_UnitNumber(strainULS.ToUnit(DefaultUnits.StrainUnitResult));
DA.SetData(0, outStrainULS);

Expand All @@ -95,7 +96,7 @@
DA.SetData(1, outStressULS);

// SLS strain
var strainSLS = sls.Deformation.StrainAt(AdSecInput.IPoint(this, DA, 2));
var strainSLS = sls.Deformation.StrainAt(point);

Check warning on line 99 in AdSecGH/Components/6_Results/ConcreteStressStrain.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Components/6_Results/ConcreteStressStrain.cs#L99

Added line #L99 was not covered by tests
var outStrainSLS = new GH_UnitNumber(strainSLS.ToUnit(DefaultUnits.StrainUnitResult));
DA.SetData(2, outStrainSLS);

Expand Down
Loading
Loading