Skip to content

Commit a1ae929

Browse files
authored
ADSECGH-35: Set-up-unit-testing-and-code-coverage (#96)
* local code coverage workflow * ignore idea and results folders * wrong line endings * braught back the code coverage check * do not stop report if tests fail * changed bitwise to logical operators * added not implemented flag on unflattened test * feat: braught back the .editorconfig and formated sln * feat: formated usings to include groups * feat: ignore naming convention on AboutBox * feat: added upload code coverage to codecovio
1 parent 5956947 commit a1ae929

File tree

87 files changed

+874
-361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+874
-361
lines changed

.editorconfig

Lines changed: 117 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -13,171 +13,171 @@ tab_width = 1
1313

1414
# New line preferences
1515
end_of_line = lf
16-
insert_final_newline = true:error
16+
insert_final_newline = true
1717

1818
#### .NET Coding Conventions ####
1919

2020
# Organize usings
21-
dotnet_separate_import_directive_groups = true:error
22-
dotnet_sort_system_directives_first = true:error
21+
dotnet_separate_import_directive_groups = true
22+
dotnet_sort_system_directives_first = true
2323
file_header_template = unset
2424

2525
# this. and Me. preferences
26-
dotnet_style_qualification_for_event = false:error
27-
dotnet_style_qualification_for_field = false:error
28-
dotnet_style_qualification_for_method = false:error
29-
dotnet_style_qualification_for_property = false:error
26+
dotnet_style_qualification_for_event = false
27+
dotnet_style_qualification_for_field = false
28+
dotnet_style_qualification_for_method = false
29+
dotnet_style_qualification_for_property = false
3030

3131
# Language keywords vs BCL types preferences
32-
dotnet_style_predefined_type_for_locals_parameters_members = true:error
33-
dotnet_style_predefined_type_for_member_access = true:error
32+
dotnet_style_predefined_type_for_locals_parameters_members = true
33+
dotnet_style_predefined_type_for_member_access = true
3434

3535
# Parentheses preferences
36-
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
37-
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
38-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error
39-
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error
36+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
37+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
38+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
39+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
4040

4141
# Modifier preferences
42-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
42+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
4343

4444
# Expression-level preferences
45-
dotnet_style_coalesce_expression = true:error
46-
dotnet_style_collection_initializer = true:error
47-
dotnet_style_explicit_tuple_names = true:error
48-
dotnet_style_namespace_match_folder = true:error
49-
dotnet_style_null_propagation = true:error
50-
dotnet_style_object_initializer = true:error
51-
dotnet_style_operator_placement_when_wrapping = beginning_of_line:error
52-
dotnet_style_prefer_auto_properties = true:error
53-
dotnet_style_prefer_compound_assignment = true:error
45+
dotnet_style_coalesce_expression = true
46+
dotnet_style_collection_initializer = true
47+
dotnet_style_explicit_tuple_names = true
48+
dotnet_style_namespace_match_folder = true
49+
dotnet_style_null_propagation = true
50+
dotnet_style_object_initializer = true
51+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
52+
dotnet_style_prefer_auto_properties = true
53+
dotnet_style_prefer_compound_assignment = true
5454
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
5555
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
56-
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed:error
57-
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
58-
dotnet_style_prefer_inferred_tuple_names = true:error
59-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
60-
dotnet_style_prefer_simplified_boolean_expressions = true:error
61-
dotnet_style_prefer_simplified_interpolation = true:error
56+
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
57+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
58+
dotnet_style_prefer_inferred_tuple_names = true
59+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
60+
dotnet_style_prefer_simplified_boolean_expressions = true
61+
dotnet_style_prefer_simplified_interpolation = true
6262

6363
# Field preferences
6464
dotnet_style_readonly_field = true:suggestion
6565

6666
# Parameter preferences
67-
dotnet_code_quality_unused_parameters = all:error
67+
dotnet_code_quality_unused_parameters = all
6868

6969
# Suppression preferences
70-
dotnet_remove_unnecessary_suppression_exclusions = none:error
70+
dotnet_remove_unnecessary_suppression_exclusions = none
7171

7272
# New line preferences
73-
dotnet_style_allow_multiple_blank_lines_experimental = true:error
74-
dotnet_style_allow_statement_immediately_after_block_experimental = true:error
73+
dotnet_style_allow_multiple_blank_lines_experimental = true
74+
dotnet_style_allow_statement_immediately_after_block_experimental = true
7575

7676
#### C# Coding Conventions ####
7777

7878
# var preferences
79-
csharp_style_var_elsewhere = false:error
80-
csharp_style_var_for_built_in_types = false:error
81-
csharp_style_var_when_type_is_apparent = true:error
79+
csharp_style_var_elsewhere = true
80+
csharp_style_var_for_built_in_types = false
81+
csharp_style_var_when_type_is_apparent = true
8282

8383
# Expression-bodied members
84-
csharp_style_expression_bodied_accessors = true:error
85-
csharp_style_expression_bodied_constructors = false:error
86-
csharp_style_expression_bodied_indexers = true:error
87-
csharp_style_expression_bodied_lambdas = true:error
88-
csharp_style_expression_bodied_local_functions = false:error
89-
csharp_style_expression_bodied_methods = false:error
90-
csharp_style_expression_bodied_operators = false:error
91-
csharp_style_expression_bodied_properties = true:error
84+
csharp_style_expression_bodied_accessors = true
85+
csharp_style_expression_bodied_constructors = false
86+
csharp_style_expression_bodied_indexers = true
87+
csharp_style_expression_bodied_lambdas = true
88+
csharp_style_expression_bodied_local_functions = false
89+
csharp_style_expression_bodied_methods = false
90+
csharp_style_expression_bodied_operators = false
91+
csharp_style_expression_bodied_properties = true
9292

9393
# Pattern matching preferences
94-
csharp_style_pattern_matching_over_as_with_null_check = true:error
95-
csharp_style_pattern_matching_over_is_with_cast_check = true:error
96-
csharp_style_prefer_extended_property_pattern = true:error
97-
csharp_style_prefer_not_pattern = true:error
98-
csharp_style_prefer_pattern_matching = true:error
99-
csharp_style_prefer_switch_expression = true:error
94+
csharp_style_pattern_matching_over_as_with_null_check = true
95+
csharp_style_pattern_matching_over_is_with_cast_check = true
96+
csharp_style_prefer_extended_property_pattern = true
97+
csharp_style_prefer_not_pattern = true
98+
csharp_style_prefer_pattern_matching = true
99+
csharp_style_prefer_switch_expression = true
100100

101101
# Null-checking preferences
102-
csharp_style_conditional_delegate_call = true:error
102+
csharp_style_conditional_delegate_call = true
103103

104104
# Modifier preferences
105-
csharp_prefer_static_local_function = true:error
106-
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
107-
csharp_style_prefer_readonly_struct = true:error
105+
csharp_prefer_static_local_function = true
106+
csharp_preferred_modifier_order = public, private, protected, internal, file, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, required, volatile, async
107+
csharp_style_prefer_readonly_struct = true
108108

109109
# Code-block preferences
110110
csharp_prefer_braces = true:error
111-
csharp_prefer_simple_using_statement = true:error
112-
csharp_style_namespace_declarations = block_scoped:error
113-
csharp_style_prefer_method_group_conversion = true:error
114-
csharp_style_prefer_top_level_statements = true:error
111+
csharp_prefer_simple_using_statement = true
112+
csharp_style_namespace_declarations = block_scoped
113+
csharp_style_prefer_method_group_conversion = true
114+
csharp_style_prefer_top_level_statements = true
115115

116116
# Expression-level preferences
117-
csharp_prefer_simple_default_expression = true:error
118-
csharp_style_deconstructed_variable_declaration = true:error
119-
csharp_style_implicit_object_creation_when_type_is_apparent = true:error
120-
csharp_style_inlined_variable_declaration = true:error
121-
csharp_style_prefer_index_operator = true:error
122-
csharp_style_prefer_local_over_anonymous_function = true:error
123-
csharp_style_prefer_null_check_over_type_check = true:error
124-
csharp_style_prefer_range_operator = true:error
125-
csharp_style_prefer_tuple_swap = true:error
126-
csharp_style_prefer_utf8_string_literals = true:error
127-
csharp_style_throw_expression = true:error
117+
csharp_prefer_simple_default_expression = true
118+
csharp_style_deconstructed_variable_declaration = true
119+
csharp_style_implicit_object_creation_when_type_is_apparent = true
120+
csharp_style_inlined_variable_declaration = true
121+
csharp_style_prefer_index_operator = true
122+
csharp_style_prefer_local_over_anonymous_function = true
123+
csharp_style_prefer_null_check_over_type_check = true
124+
csharp_style_prefer_range_operator = true
125+
csharp_style_prefer_tuple_swap = true
126+
csharp_style_prefer_utf8_string_literals = true
127+
csharp_style_throw_expression = true
128128
csharp_style_unused_value_assignment_preference = discard_variable:none
129129
csharp_style_unused_value_expression_statement_preference = discard_variable:none
130130

131131
# 'using' directive preferences
132-
csharp_using_directive_placement = outside_namespace:error
132+
csharp_using_directive_placement = outside_namespace
133133

134134
# New line preferences
135-
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:error
136-
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:error
137-
csharp_style_allow_embedded_statements_on_same_line_experimental = true:error
135+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
136+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
137+
csharp_style_allow_embedded_statements_on_same_line_experimental = true
138138

139139
#### C# Formatting Rules ####
140140

141141
# New line preferences
142-
csharp_new_line_before_open_brace = none:error
143-
csharp_new_line_before_catch = false:error
144-
csharp_new_line_before_else = false:error
145-
csharp_new_line_before_finally = false:error
146-
csharp_new_line_before_members_in_anonymous_types = false:error
147-
csharp_new_line_before_members_in_object_initializers = false:error
148-
csharp_new_line_between_query_expression_clauses = false:error
142+
csharp_new_line_before_open_brace = none
143+
csharp_new_line_before_catch = false
144+
csharp_new_line_before_else = false
145+
csharp_new_line_before_finally = false
146+
csharp_new_line_before_members_in_anonymous_types = false
147+
csharp_new_line_before_members_in_object_initializers = false
148+
csharp_new_line_between_query_expression_clauses = false
149149

150150
# Indentation preferences
151-
csharp_indent_block_contents = true:error
152-
csharp_indent_braces = false:error
153-
csharp_indent_case_contents = true:error
154-
csharp_indent_case_contents_when_block = true:error
155-
csharp_indent_labels = one_less_than_current:error
156-
csharp_indent_switch_labels = true:error
151+
csharp_indent_block_contents = true
152+
csharp_indent_braces = false
153+
csharp_indent_case_contents = true
154+
csharp_indent_case_contents_when_block = true
155+
csharp_indent_labels = one_less_than_current
156+
csharp_indent_switch_labels = true
157157

158158
# Space preferences
159-
csharp_space_after_cast = false:error
160-
csharp_space_after_colon_in_inheritance_clause = true:error
161-
csharp_space_after_comma = true:error
162-
csharp_space_after_dot = false:error
163-
csharp_space_after_keywords_in_control_flow_statements = true:error
164-
csharp_space_after_semicolon_in_for_statement = true:error
165-
csharp_space_around_binary_operators = before_and_after:error
166-
csharp_space_around_declaration_statements = false:error
167-
csharp_space_before_colon_in_inheritance_clause = true:error
168-
csharp_space_before_comma = false:error
169-
csharp_space_before_dot = false:error
170-
csharp_space_before_open_square_brackets = false:error
171-
csharp_space_before_semicolon_in_for_statement = false:error
172-
csharp_space_between_empty_square_brackets = false:error
173-
csharp_space_between_method_call_empty_parameter_list_parentheses = false:error
174-
csharp_space_between_method_call_name_and_opening_parenthesis = false:error
175-
csharp_space_between_method_call_parameter_list_parentheses = false:error
176-
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:error
177-
csharp_space_between_method_declaration_name_and_open_parenthesis = false:error
178-
csharp_space_between_method_declaration_parameter_list_parentheses = false:error
179-
csharp_space_between_parentheses = false:error
180-
csharp_space_between_square_brackets = false:error
159+
csharp_space_after_cast = false
160+
csharp_space_after_colon_in_inheritance_clause = true
161+
csharp_space_after_comma = true
162+
csharp_space_after_dot = false
163+
csharp_space_after_keywords_in_control_flow_statements = true
164+
csharp_space_after_semicolon_in_for_statement = true
165+
csharp_space_around_binary_operators = before_and_after
166+
csharp_space_around_declaration_statements = false
167+
csharp_space_before_colon_in_inheritance_clause = true
168+
csharp_space_before_comma = false
169+
csharp_space_before_dot = false
170+
csharp_space_before_open_square_brackets = false
171+
csharp_space_before_semicolon_in_for_statement = false
172+
csharp_space_between_empty_square_brackets = false
173+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
174+
csharp_space_between_method_call_name_and_opening_parenthesis = false
175+
csharp_space_between_method_call_parameter_list_parentheses = false
176+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
177+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
178+
csharp_space_between_method_declaration_parameter_list_parentheses = false
179+
csharp_space_between_parentheses = false
180+
csharp_space_between_square_brackets = false
181181

182182
# Wrapping preferences
183183
csharp_preserve_single_line_blocks = true
@@ -203,26 +203,26 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
203203

204204
dotnet_naming_symbols.interface.applicable_kinds = interface
205205
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
206-
dotnet_naming_symbols.interface.required_modifiers =
206+
dotnet_naming_symbols.interface.required_modifiers =
207207

208208
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
209209
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
210-
dotnet_naming_symbols.types.required_modifiers =
210+
dotnet_naming_symbols.types.required_modifiers =
211211

212212
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
213213
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
214-
dotnet_naming_symbols.non_field_members.required_modifiers =
214+
dotnet_naming_symbols.non_field_members.required_modifiers =
215215

216216
# Naming styles
217217

218-
dotnet_naming_style.pascal_case.required_prefix =
219-
dotnet_naming_style.pascal_case.required_suffix =
220-
dotnet_naming_style.pascal_case.word_separator =
218+
dotnet_naming_style.pascal_case.required_prefix =
219+
dotnet_naming_style.pascal_case.required_suffix =
220+
dotnet_naming_style.pascal_case.word_separator =
221221
dotnet_naming_style.pascal_case.capitalization = pascal_case
222222

223223
dotnet_naming_style.begins_with_i.required_prefix = I
224-
dotnet_naming_style.begins_with_i.required_suffix =
225-
dotnet_naming_style.begins_with_i.word_separator =
224+
dotnet_naming_style.begins_with_i.required_suffix =
225+
dotnet_naming_style.begins_with_i.word_separator =
226226
dotnet_naming_style.begins_with_i.capitalization = pascal_case
227227

228228
# ReSharper properties
@@ -256,7 +256,7 @@ resharper_braces_for_ifelse = required
256256
resharper_braces_for_while = required
257257
resharper_csharp_keep_blank_lines_in_code = 1
258258
resharper_csharp_keep_blank_lines_in_declarations = 1
259-
resharper_csharp_max_line_length = 100
259+
resharper_csharp_max_line_length = 120
260260
resharper_csharp_wrap_arguments_style = wrap_if_long
261261
resharper_csharp_wrap_before_binary_opsign = true
262262
resharper_csharp_wrap_multiple_declaration_style = chop_always

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/.idea
2+
/results
13
/.vs
24
packages
35
AdSecGH/bin

AdSecGH/AdSecGHInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Drawing;
3+
34
using Grasshopper.Kernel;
45

56
namespace AdSecGH {

AdSecGH/AddReferenceProperty.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
using System;
22
using System.IO;
33
using System.Reflection;
4+
45
using AdSecGH.Graphics.Menu;
56
using AdSecGH.Properties;
7+
68
using Grasshopper;
79
using Grasshopper.Kernel;
10+
811
using Oasys.AdSec;
912
using Oasys.AdSec.DesignCode;
13+
1014
using OasysGH.Helpers;
15+
1116
using Rhino;
17+
1218
using Utility = OasysGH.Utility;
1319

1420
namespace AdSecGH {

AdSecGH/Components/0_AdSec/OpenModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
using System.Drawing;
44
using System.IO;
55
using System.Linq;
6+
67
using AdSecGH.Helpers;
78
using AdSecGH.Helpers.GH;
89
using AdSecGH.Parameters;
10+
911
using Grasshopper.Kernel;
1012
using Grasshopper.Kernel.Types;
13+
1114
using Oasys.AdSec.DesignCode;
1215
using Oasys.AdSec.IO.Serialization;
16+
1317
using OasysGH;
1418
using OasysGH.Components;
1519
using OasysGH.UI;
20+
1621
using Rhino.Geometry;
1722

1823
namespace AdSecGH.Components {

0 commit comments

Comments
 (0)