Skip to content

Commit c97beef

Browse files
authored
+semver:minor - Refactored Context objects so they can access their parent (Test > Class > Assembly > Session) (#2505)
* Refactor Engine tests for a speeder pipeline * Whoops * Update snaps * Print command * Fix * Fix * WIP * Refactor Context objects * WIP * WIP * WIP * WIP * Fixes * Fixes * Fix * Fix * Fixes * Fixes * Fixes * Fixes * Fixes * Fixes * Tweak * Update WindowsOnlyAttribute.cs * Update snaps * WIP * Fix nested class data sources * WIP * WIP * WIP * WIP * WIP * WIP * WIP * Fixes * Fix ReturnValue tests * WIP * Fixes * Fix * Fixes * WIP * Fix * Fixes * Fixes * Fixes * Fixes * Fixes * WIP * Fixes * Fixes * WIP * if statement * PropertyInitializationGenerator * Fixes * Add common interface method for IDataSourceGeneratorAttribute.cs * Fix? * Fix * Fixes * Update snaps * Remove debug line * Remove logs
1 parent b2cf26b commit c97beef

File tree

349 files changed

+6149
-3216
lines changed

Some content is hidden

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

349 files changed

+6149
-3216
lines changed

.editorconfig

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,132 @@
11
root = true
22

3+
[*]
4+
insert_final_newline = true
5+
indent_style = space
6+
indent_size = 4
7+
trim_trailing_whitespace = true
8+
9+
[project.json]
10+
indent_size = 2
11+
12+
# Generated code
13+
[*{_AssemblyInfo.cs,.notsupported.cs}]
14+
generated_code = true
15+
16+
# C# files
17+
[*.cs]
18+
# New line preferences
19+
csharp_new_line_before_open_brace = all
20+
csharp_new_line_before_else = true
21+
csharp_new_line_before_catch = true
22+
csharp_new_line_before_finally = true
23+
csharp_new_line_before_members_in_object_initializers = true
24+
csharp_new_line_before_members_in_anonymous_types = true
25+
csharp_new_line_between_query_expression_clauses = true
26+
27+
# Indentation preferences
28+
csharp_indent_block_contents = true
29+
csharp_indent_braces = false
30+
csharp_indent_case_contents = true
31+
csharp_indent_case_contents_when_block = true
32+
csharp_indent_switch_labels = true
33+
csharp_indent_labels = one_less_than_current
34+
35+
# Modifier preferences
36+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
37+
38+
# avoid this. unless absolutely necessary
39+
dotnet_style_qualification_for_field = false:suggestion
40+
dotnet_style_qualification_for_property = false:suggestion
41+
dotnet_style_qualification_for_method = false:suggestion
42+
dotnet_style_qualification_for_event = false:suggestion
43+
44+
# name all constant fields using PascalCase
45+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
46+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
47+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
48+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
49+
dotnet_naming_symbols.constant_fields.required_modifiers = const
50+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
51+
52+
# internal and private fields should be _camelCase
53+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
54+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
55+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
56+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
57+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
58+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
59+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
60+
61+
# Code style defaults
62+
csharp_using_directive_placement = outside_namespace:suggestion
63+
dotnet_sort_system_directives_first = true
64+
csharp_prefer_braces = true:silent
65+
csharp_preserve_single_line_blocks = true:none
66+
csharp_preserve_single_line_statements = false:none
67+
csharp_prefer_static_local_function = true:suggestion
68+
csharp_style_prefer_switch_expression = true:suggestion
69+
dotnet_style_readonly_field = true:suggestion
70+
71+
# Expression-level preferences
72+
dotnet_style_object_initializer = true:suggestion
73+
dotnet_style_collection_initializer = true:suggestion
74+
dotnet_style_explicit_tuple_names = true:suggestion
75+
dotnet_style_coalesce_expression = true:suggestion
76+
dotnet_style_null_propagation = true:suggestion
77+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
78+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
79+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
80+
dotnet_style_prefer_auto_properties = true:suggestion
81+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
82+
dotnet_style_prefer_conditional_expression_over_return = true:silent
83+
84+
# Expression-bodied members
85+
csharp_style_expression_bodied_methods = true:silent
86+
csharp_style_expression_bodied_constructors = true:silent
87+
csharp_style_expression_bodied_operators = true:silent
88+
csharp_style_expression_bodied_properties = true:silent
89+
csharp_style_expression_bodied_indexers = true:silent
90+
csharp_style_expression_bodied_accessors = true:silent
91+
csharp_style_expression_bodied_lambdas = true:silent
92+
csharp_style_expression_bodied_local_functions = true:silent
93+
94+
# Pattern matching
95+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
96+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
97+
csharp_style_inlined_variable_declaration = true:suggestion
98+
99+
# Null checking preferences
100+
csharp_style_throw_expression = true:suggestion
101+
csharp_style_conditional_delegate_call = true:suggestion
102+
103+
# Space preferences
104+
csharp_space_after_cast = true
105+
csharp_space_after_colon_in_inheritance_clause = true
106+
csharp_space_after_comma = true
107+
csharp_space_after_dot = false
108+
csharp_space_after_keywords_in_control_flow_statements = true
109+
csharp_space_after_semicolon_in_for_statement = true
110+
csharp_space_around_binary_operators = before_and_after
111+
csharp_space_around_declaration_statements = do_not_ignore
112+
csharp_space_before_colon_in_inheritance_clause = true
113+
csharp_space_before_comma = false
114+
csharp_space_before_dot = false
115+
csharp_space_before_open_square_brackets = false
116+
csharp_space_before_semicolon_in_for_statement = false
117+
csharp_space_between_empty_square_brackets = false
118+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
119+
csharp_space_between_method_call_name_and_opening_parenthesis = false
120+
csharp_space_between_method_call_parameter_list_parentheses = false
121+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
122+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
123+
csharp_space_between_method_declaration_parameter_list_parentheses = false
124+
csharp_space_between_parentheses = false
125+
csharp_space_between_square_brackets = false
126+
3127
[*.{cs,vb}]
4128
dotnet_diagnostic.TUnitAssertions0003.severity=silent
5129

6-
7130
# Verify
8131
[*.{received,verified}.{txt}]
9132
charset = "utf-8-bom"
@@ -12,4 +135,4 @@ indent_size = unset
12135
indent_style = unset
13136
insert_final_newline = false
14137
tab_width = unset
15-
trim_trailing_whitespace = false
138+
trim_trailing_whitespace = false

TUnit.Core.SourceGenerator.Tests/AfterAllTests.Test.verified.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
638638
{
639639
Name = "context",
640640
Attributes = [],
641+
ReflectionInfo = null!,
641642
},
642643
],
643644
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -728,6 +729,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
728729
{
729730
Name = "cancellationToken",
730731
Attributes = [],
732+
ReflectionInfo = null!,
731733
},
732734
],
733735
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -818,11 +820,13 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
818820
{
819821
Name = "context",
820822
Attributes = [],
823+
ReflectionInfo = null!,
821824
},
822825
new global::TUnit.Core.SourceGeneratedParameterInformation<global::System.Threading.CancellationToken>
823826
{
824827
Name = "cancellationToken",
825828
Attributes = [],
829+
ReflectionInfo = null!,
826830
},
827831
],
828832
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -997,6 +1001,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
9971001
{
9981002
Name = "cancellationToken",
9991003
Attributes = [],
1004+
ReflectionInfo = null!,
10001005
},
10011006
],
10021007
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -1086,6 +1091,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
10861091
{
10871092
Name = "testContext",
10881093
Attributes = [],
1094+
ReflectionInfo = null!,
10891095
},
10901096
],
10911097
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -1176,11 +1182,13 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
11761182
{
11771183
Name = "testContext",
11781184
Attributes = [],
1185+
ReflectionInfo = null!,
11791186
},
11801187
new global::TUnit.Core.SourceGeneratedParameterInformation<global::System.Threading.CancellationToken>
11811188
{
11821189
Name = "cancellationToken",
11831190
Attributes = [],
1191+
ReflectionInfo = null!,
11841192
},
11851193
],
11861194
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation

TUnit.Core.SourceGenerator.Tests/AfterTests.Test.verified.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
638638
{
639639
Name = "context",
640640
Attributes = [],
641+
ReflectionInfo = null!,
641642
},
642643
],
643644
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -728,6 +729,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
728729
{
729730
Name = "cancellationToken",
730731
Attributes = [],
732+
ReflectionInfo = null!,
731733
},
732734
],
733735
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -818,11 +820,13 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
818820
{
819821
Name = "context",
820822
Attributes = [],
823+
ReflectionInfo = null!,
821824
},
822825
new global::TUnit.Core.SourceGeneratedParameterInformation<global::System.Threading.CancellationToken>
823826
{
824827
Name = "cancellationToken",
825828
Attributes = [],
829+
ReflectionInfo = null!,
826830
},
827831
],
828832
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -997,6 +1001,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
9971001
{
9981002
Name = "cancellationToken",
9991003
Attributes = [],
1004+
ReflectionInfo = null!,
10001005
},
10011006
],
10021007
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -1086,6 +1091,7 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
10861091
{
10871092
Name = "testContext",
10881093
Attributes = [],
1094+
ReflectionInfo = null!,
10891095
},
10901096
],
10911097
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -1176,11 +1182,13 @@ file partial class Hooks_CleanupTests : global::TUnit.Core.Interfaces.SourceGene
11761182
{
11771183
Name = "testContext",
11781184
Attributes = [],
1185+
ReflectionInfo = null!,
11791186
},
11801187
new global::TUnit.Core.SourceGeneratedParameterInformation<global::System.Threading.CancellationToken>
11811188
{
11821189
Name = "cancellationToken",
11831190
Attributes = [],
1191+
ReflectionInfo = null!,
11841192
},
11851193
],
11861194
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.AfterTests.CleanupTests", () => new global::TUnit.Core.SourceGeneratedClassInformation

TUnit.Core.SourceGenerator.Tests/ArgsAsArrayTests.Test.verified.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ file partial class ArgsAsArrayTests : global::TUnit.Core.Interfaces.SourceGenera
4545
{
4646
Name = "arguments",
4747
Attributes = [],
48+
ReflectionInfo = null!,
4849
},
4950
],
5051
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgsAsArrayTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -161,6 +162,7 @@ file partial class ArgsAsArrayTests : global::TUnit.Core.Interfaces.SourceGenera
161162
{
162163
Name = "arguments",
163164
Attributes = [],
165+
ReflectionInfo = null!,
164166
},
165167
],
166168
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgsAsArrayTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -277,6 +279,7 @@ file partial class ArgsAsArrayTests : global::TUnit.Core.Interfaces.SourceGenera
277279
{
278280
Name = "arguments",
279281
Attributes = [],
282+
ReflectionInfo = null!,
280283
},
281284
],
282285
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgsAsArrayTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -393,6 +396,7 @@ file partial class ArgsAsArrayTests : global::TUnit.Core.Interfaces.SourceGenera
393396
{
394397
Name = "arguments",
395398
Attributes = [],
399+
ReflectionInfo = null!,
396400
},
397401
],
398402
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgsAsArrayTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -509,11 +513,13 @@ file partial class ArgsAsArrayTests : global::TUnit.Core.Interfaces.SourceGenera
509513
{
510514
Name = "i",
511515
Attributes = [],
516+
ReflectionInfo = null!,
512517
},
513518
new global::TUnit.Core.SourceGeneratedParameterInformation<global::System.Collections.Generic.IEnumerable<string>>
514519
{
515520
Name = "arguments",
516521
Attributes = [],
522+
ReflectionInfo = null!,
517523
},
518524
],
519525
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgsAsArrayTests", () => new global::TUnit.Core.SourceGeneratedClassInformation

TUnit.Core.SourceGenerator.Tests/ArgumentWithImplicitConverterTests.Test.verified.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ file partial class ArgumentWithImplicitConverterTests : global::TUnit.Core.Inter
5252
{
5353
Name = "integer",
5454
Attributes = [],
55+
ReflectionInfo = null!,
5556
},
5657
],
5758
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgumentWithImplicitConverterTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -145,6 +146,7 @@ file partial class ArgumentWithImplicitConverterTests : global::TUnit.Core.Inter
145146
{
146147
Name = "integer",
147148
Attributes = [],
149+
ReflectionInfo = null!,
148150
},
149151
],
150152
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgumentWithImplicitConverterTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -238,6 +240,7 @@ file partial class ArgumentWithImplicitConverterTests : global::TUnit.Core.Inter
238240
{
239241
Name = "integer",
240242
Attributes = [],
243+
ReflectionInfo = null!,
241244
},
242245
],
243246
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgumentWithImplicitConverterTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -361,6 +364,7 @@ file partial class ArgumentWithImplicitConverterTests : global::TUnit.Core.Inter
361364
{
362365
Name = "integer",
363366
Attributes = [],
367+
ReflectionInfo = null!,
364368
},
365369
],
366370
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgumentWithImplicitConverterTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -454,6 +458,7 @@ file partial class ArgumentWithImplicitConverterTests : global::TUnit.Core.Inter
454458
{
455459
Name = "integer",
456460
Attributes = [],
461+
ReflectionInfo = null!,
457462
},
458463
],
459464
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgumentWithImplicitConverterTests", () => new global::TUnit.Core.SourceGeneratedClassInformation
@@ -547,6 +552,7 @@ file partial class ArgumentWithImplicitConverterTests : global::TUnit.Core.Inter
547552
{
548553
Name = "integer",
549554
Attributes = [],
555+
ReflectionInfo = null!,
550556
},
551557
],
552558
Class = global::TUnit.Core.SourceGeneratedClassInformation.GetOrAdd("global::TUnit.TestProject.ArgumentWithImplicitConverterTests", () => new global::TUnit.Core.SourceGeneratedClassInformation

0 commit comments

Comments
 (0)