Skip to content

Commit

Permalink
Merge pull request #39 from MagmaWorks/task/concrete-section-update
Browse files Browse the repository at this point in the history
ConcreteSection cover
  • Loading branch information
kpne authored Nov 5, 2024
2 parents b321dbd + 4eca822 commit eab32f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Sections/ISections/IConcreteSection.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using OasysUnits;

namespace MagmaWorks.Taxonomy.Sections
{
public interface IConcreteSection : ISection
{
Length Cover { get; }
IList<ILongitudinalReinforcement> Rebars { get; }
IRebar Link { get; }
}
Expand Down
4 changes: 3 additions & 1 deletion Sections/SectionTests/ConcreteSectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ public void CreateConcreteSectionTest()
IRectangle profile = new Rectangle(new Length(50, LengthUnit.Centimeter), new Length(100, LengthUnit.Centimeter));
IList<ILongitudinalReinforcement> rebars = LongitudinalReinforcementTests.CreateLongitudinalReinforcements();
IRebar link = RebarTests.CreateRebar(8);
Length cover = new Length(20, LengthUnit.Millimeter);

// Act
IConcreteSection section = new ConcreteSection(material, profile, rebars, link);
IConcreteSection section = new ConcreteSection(material, profile, rebars, link, cover);

// Assert
Assert.Equivalent(profile, section.Profile);
Assert.Equivalent(material, section.Material);
Assert.Equivalent(rebars, section.Rebars);
Assert.Equivalent(link, section.Link);
Assert.Equivalent(cover, section.Cover);
}


Expand Down
5 changes: 4 additions & 1 deletion Sections/Sections/ConcreteSection.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using MagmaWorks.Taxonomy.Materials;
using MagmaWorks.Taxonomy.Profiles;
using OasysUnits;

namespace MagmaWorks.Taxonomy.Sections
{
Expand All @@ -10,13 +11,15 @@ public class ConcreteSection : IConcreteSection
public IProfile Profile { get; set; }
public IList<ILongitudinalReinforcement> Rebars { get; set; } = new List<ILongitudinalReinforcement>();
public IRebar Link { get; set; }
public Length Cover { get; set; }

public ConcreteSection(IMaterial material, IProfile profile, IList<ILongitudinalReinforcement> rebars, IRebar link)
public ConcreteSection(IMaterial material, IProfile profile, IList<ILongitudinalReinforcement> rebars, IRebar link, Length cover)
{
Material = material;
Profile = profile;
Rebars = rebars;
Link = link;
Cover = cover;
}
}
}

0 comments on commit eab32f3

Please sign in to comment.