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-99: Create Section Tests #136

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

psarras
Copy link
Collaborator

@psarras psarras commented Mar 10, 2025

…organisation

@psarras psarras requested a review from Copilot March 10, 2025 11:20
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR introduces a new function for creating sections and adapts it for use in the Grasshopper environment to support section testing functionality.

  • Adds CreateSectionFunction with metadata and organisation settings.
  • Implements a GH component adapter by subclassing the new function.
  • Integrates necessary using statements to support the new component structure.

Reviewed Changes

File Description
AdSecCore/Functions/CreateSectionFunction.cs Introduces a function class for section creation with associated metadata.
AdSecGH/Components/3_Section/CreateSection.cs Adopts a component adapter pattern by extending the function class for Grasshopper integration.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

AdSecGH/Components/3_Section/CreateSection.cs:29

  • [nitpick] The class name 'CreateSectionGh' could be more descriptive. Consider renaming it to clearly reflect its role as an adapter for the CreateSectionFunction in the Grasshopper context.
public class CreateSectionGh : CreateSectionFunction {

@psarras psarras force-pushed the task/ADSECGH-99-Create-Section-Tests branch from ccd631f to 8553d2d Compare March 10, 2025 12:05
@psarras psarras requested a review from Copilot March 10, 2025 20:12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR introduces tests and updates to the section creation functionality across both core libraries and Grasshopper components. Key changes include:

  • Adding unit tests for both the core CreateSectionFunction and the Grasshopper CreateSection component.
  • Updating the ProfileBuilder and SectionBuilder implementations to support the new test requirements.
  • Enhancing parameter classes and helper conversions for improved consistency in the API usage.

Reviewed Changes

File Description
AdSecCoreTests/Functions/CreateSectionFunctionTests.cs New unit tests validating input/output counts and section creation.
AdSecGHTests/Components/03_Section/CreateSectionTests.cs New tests checking the component’s input/output parameters.
AdSecCore/Builders/ProfileBuilder.cs Added builder methods for profile creation.
AdSecCore/Functions/CreateSectionFunction.cs Implementation of section creation logic using SectionBuilder.
AdSecGH/Components/3_Section/CreateSection.cs Updated GH component with event handling and output mapping.
AdSecCore/Builders/SectionBuilder.cs Revised builder logic with renaming of internal dimensions.
AdSecCore/Functions/ParametersGeneric.cs Added new parameter classes for profiles and materials.
AdSecGH/Helpers/BusinessExtensions.cs Updated helper to convert parameters to GH types.
AdSecGH/Components/2_Profile/CreateProfile.cs Adjusted type annotations in profile creation component.
AdSecGH/Components/3_Section/FlattenRebar.cs Minor formatting update in Rebar flattening component.

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

AdSecCore/Builders/SectionBuilder.cs:107

  • [nitpick] The method 'WithHeight' sets the internal variable '_depth', which may be inconsistent with its name. Consider renaming it to 'WithDepth' for clarity.
public SectionBuilder WithHeight(double height) {
@psarras psarras force-pushed the task/ADSECGH-99-Create-Section-Tests branch from 9563545 to 45695cc Compare March 13, 2025 09:07
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 92.91667% with 17 lines in your changes missing coverage. Please review.

Project coverage is 51.0%. Comparing base (0c7302d) to head (143554d).

Files with missing lines Patch % Lines
AdSecGH/Components/3_Section/CreateSection.cs 39.1% 14 Missing ⚠️
AdSecCore/AdSecRebarGroup.cs 70.0% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #136     +/-   ##
=======================================
+ Coverage   50.0%   51.0%   +1.0%     
=======================================
  Files        103     106      +3     
  Lines       6931    6994     +63     
  Branches     870     872      +2     
=======================================
+ Hits        3467    3570    +103     
+ Misses      3391    3350     -41     
- Partials      73      74      +1     
Files with missing lines Coverage Δ
AdSecCore/Builders/BuilderLineGroup.cs 100.0% <100.0%> (ø)
AdSecCore/Builders/BuilderReinforcementGroup.cs 100.0% <100.0%> (ø)
AdSecCore/Builders/ProfileBuilder.cs 100.0% <100.0%> (ø)
AdSecCore/Builders/SectionBuilder.cs 100.0% <100.0%> (ø)
AdSecCore/Builders/SolutionBuilder.cs 100.0% <100.0%> (ø)
AdSecCore/Functions/CreateSectionFunction.cs 100.0% <100.0%> (ø)
AdSecCore/Functions/ParametersGeneric.cs 100.0% <100.0%> (ø)
AdSecGH/Components/2_Profile/CreateProfile.cs 28.8% <ø> (ø)
AdSecGH/Components/3_Section/FlattenRebar.cs 94.7% <ø> (-0.2%) ⬇️
AdSecGH/Helpers/BusinessExtensions.cs 96.8% <100.0%> (+0.8%) ⬆️
... and 3 more
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant