Skip to content

Commit

Permalink
test: removed unecessary code and clarified helper for tests project
Browse files Browse the repository at this point in the history
  • Loading branch information
psarras committed Nov 1, 2024
1 parent c805f73 commit 4604562
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 54 deletions.
22 changes: 0 additions & 22 deletions AdSecGH/Helpers/BusinessExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using System.Collections;
using System.Collections.Generic;

using AdSecGH.Parameters;

using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
using Grasshopper.Kernel.Parameters;
Expand All @@ -20,12 +18,6 @@ public static class BusinessExtensions {
private static readonly Dictionary<Type, Func<Attribute, IGH_Param>> ToGhParam
= new Dictionary<Type, Func<Attribute, IGH_Param>> {
{
typeof(DoubleParameter), a => new Param_Number {
Name = a.Name,
NickName = a.NickName,
Description = a.Description,
}
}, {
typeof(DoubleArrayParameter), a => new Param_Number {
Name = a.Name,
NickName = a.NickName,
Expand All @@ -44,26 +36,12 @@ private static readonly Dictionary<Type, Func<Attribute, IGH_Param>> ToGhParam
private static readonly Dictionary<Type, Func<Attribute, object>> ToGoo
= new Dictionary<Type, Func<Attribute, object>> {
{
typeof(PointAttribute), a => new GH_ObjectWrapper {
Value = new AdSecPointGoo((a as PointAttribute)?.Value),
}
}, {
typeof(DoubleParameter), a => new GH_Number((a as DoubleParameter).Value)

Check warning on line 39 in AdSecGH/Helpers/BusinessExtensions.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Helpers/BusinessExtensions.cs#L39

Added line #L39 was not covered by tests
}, {
typeof(DoubleArrayParameter), a => (a as DoubleArrayParameter).Value

Check warning on line 41 in AdSecGH/Helpers/BusinessExtensions.cs

View check run for this annotation

Codecov / codecov/patch

AdSecGH/Helpers/BusinessExtensions.cs#L41

Added line #L41 was not covered by tests
},
};

private static GH_Structure<GH_Number> ToTree(DoubleArrayParameter doubleArrayParameter) {
var structure = new GH_Structure<GH_Number>();
foreach (double value in doubleArrayParameter.Value) {
var branch = new GH_Path(0);
structure.Append(new GH_Number(value), branch);
}

return structure;
}

public static void SetDefaultValues(this IBusinessComponent businessComponent) {
foreach (var attribute in businessComponent.GetAllInputAttributes()) {
if (attribute is IDefault @default) {
Expand Down
65 changes: 33 additions & 32 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
codecov:
notify:
after_n_builds: 2
comment:
behavior: new
layout: reach, diff, tree
show_carryforward_flags: false
coverage:
precision: 1
range:
- 30.0
- 75.0
round: down
status:
changes: false
default_rules:
flag_coverage_not_uploaded_behavior: include
patch: true
project:
default:
target: auto
threshold: 1%
flags:
adsecgh:
carryforward: false
integration:
carryforward: false
ignore:
- "AdSecGHTests" # ignore project (as it is referenced by Integration test)
- "AdSecGH/Components/GraveyardComp" # ignore old versions of components in graveyard folder
- "AdSecGH/Properties" # ignore icons and Resources.Designer.cs file auto-generated by visual studio
- "AdSecGH/Resources" # ignore icons etc
codecov:
notify:
after_n_builds: 2
comment:
behavior: new
layout: reach, diff, tree
show_carryforward_flags: false
coverage:
precision: 1
range:
- 30.0
- 75.0
round: down
status:
changes: false
default_rules:
flag_coverage_not_uploaded_behavior: include
patch: true
project:
default:
target: auto
threshold: 1%
flags:
adsecgh:
carryforward: false
integration:
carryforward: false
ignore:
- "AdSecGHTests" # ignore project (as it is referenced by Integration test)
- "TestGrasshopperObjects" # ignore project (as it is referenced by Integration test)
- "AdSecGH/Components/GraveyardComp" # ignore old versions of components in graveyard folder
- "AdSecGH/Properties" # ignore icons and Resources.Designer.cs file auto-generated by visual studio
- "AdSecGH/Resources" # ignore icons etc

0 comments on commit 4604562

Please sign in to comment.