Skip to content

Commit abf30c9

Browse files
committed
Refactor GqlModel generator tests to use TestSchemaInputs
1 parent 41a1669 commit abf30c9

File tree

546 files changed

+4474
-721
lines changed

Some content is hidden

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

546 files changed

+4474
-721
lines changed

test/GqlPlus.Generators.ComponentTests/Sample/SchemaGeneratorTests.cs test/GqlPlus.Generators.ComponentTests/Sample/GenerateSchemaTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
namespace GqlPlus.Sample;
77

8-
public class SchemaGeneratorTests(
8+
public class GenerateSchemaTests(
99
ISchemaGeneratorChecks checks
1010
) : TestSchemaAsts(checks)
1111
{
12-
protected override async Task Test_Asts(IEnumerable<IGqlpSchema> asts, string test, string label, string[] dirs, string testDirectory, string input = "")
12+
protected override async Task Test_Asts(IEnumerable<IGqlpSchema> asts, string test, string label, string[] dirs, string section, string input = "")
1313
{
1414
string result = checks.Generate_ForAsts(asts, test, label, input);
1515

16-
await Verify(result, CustomSettings(label, "Generator", test, testDirectory, scrubEmptyLines: false));
16+
await Verify(result, CustomSettings(label, "Generate", test, section, scrubEmptyLines: false));
1717
}
1818
}
1919

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* Intro_Built-In
2+
output _Constant {
3+
| _Simple
4+
| _ConstantList
5+
| _ConstantMap
6+
}
7+
8+
output _Simple {
9+
| Boolean
10+
| _DomainValue<_DomainKind.Number Number>
11+
| _DomainValue<_DomainKind.String String>
12+
| _EnumValue
13+
}
14+
15+
output _ConstantList {
16+
| _Constant[]
17+
}
18+
19+
output _ConstantMap {
20+
| _Constant[Simple]
21+
}
22+
23+
output _Collections {
24+
| _Modifier<_ModifierKind.List>
25+
| _ModifierKeyed<_ModifierKind.Dictionary>
26+
| _ModifierKeyed<_ModifierKind.TypeParam>
27+
}
28+
29+
output _ModifierKeyed<$kind> {
30+
: _Modifier<$kind>
31+
by: _TypeSimple
32+
optional: Boolean
33+
}
34+
35+
output _Modifiers {
36+
| _Modifier<_ModifierKind.Optional>
37+
| _Collections
38+
}
39+
40+
enum _ModifierKind { Opt[Optional] List Dict[Dictionary] Param[TypeParam] }
41+
42+
output _Modifier<$kind> {
43+
modifierKind: $kind
44+
}
45+
*/
46+
47+
// Generated from Schema Intro_Built-In
48+
49+
/*
50+
*/
51+
52+
namespace GqlPlus.Model_Schema_Intro_Built_In;
53+
54+
public interface IOutput_Constant {}
55+
56+
public interface IOutput_Simple {}
57+
58+
public interface IOutput_ConstantList {}
59+
60+
public interface IOutput_ConstantMap {}
61+
62+
public interface IOutput_Collections {}
63+
64+
public interface IOutput_ModifierKeyed {}
65+
66+
public interface IOutput_Modifiers {}
67+
68+
public enum _ModifierKind
69+
{
70+
Opt,
71+
Optional = Opt,
72+
List,
73+
Dict,
74+
Dictionary = Dict,
75+
Param,
76+
TypeParam = Param,
77+
}
78+
79+
public interface IOutput_Modifier {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* Intro_Category
2+
output _Categories {
3+
category: _Category
4+
type: _Type
5+
| _Category
6+
| _Type
7+
}
8+
9+
output _Category {
10+
: _Aliased
11+
resolution: _Resolution
12+
output: _TypeRef<_TypeKind.Output>
13+
modifiers: _Modifiers[]
14+
}
15+
16+
enum _Resolution { Parallel Sequential Single }
17+
*/
18+
19+
// Generated from Schema Intro_Category
20+
21+
/*
22+
*/
23+
24+
namespace GqlPlus.Model_Schema_Intro_Category;
25+
26+
public interface IOutput_Categories {}
27+
28+
public interface IOutput_Category {}
29+
30+
public enum _Resolution
31+
{
32+
Parallel,
33+
Sequential,
34+
Single,
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/* Intro_Common
2+
output _Type {
3+
| _BaseType<_TypeKind.Basic>
4+
| _BaseType<_TypeKind.Internal>
5+
| _TypeDual
6+
| _TypeEnum
7+
| _TypeInput
8+
| _TypeOutput
9+
| _TypeDomain
10+
| _TypeUnion
11+
}
12+
13+
output _BaseType<$kind> {
14+
: _Aliased
15+
typeKind: $kind
16+
}
17+
18+
output _ChildType<$kind $parent> {
19+
: _BaseType<$kind>
20+
parent: $parent
21+
}
22+
23+
output _ParentType<$kind $item $allItem> {
24+
: _ChildType<$kind _Named>
25+
items: $item[]
26+
allItems: $allItem[]
27+
}
28+
29+
enum _SimpleKind { Basic Enum Internal Domain Union }
30+
31+
enum _TypeKind { :_SimpleKind Dual Input Output }
32+
33+
output _TypeRef<$kind> {
34+
: _Described
35+
typeKind: $kind
36+
name: _Identifier
37+
}
38+
39+
output _TypeSimple {
40+
| _TypeRef<_TypeKind.Basic>
41+
| _TypeRef<_TypeKind.Enum>
42+
| _TypeRef<_TypeKind.Domain>
43+
| _TypeRef<_TypeKind.Union>
44+
}
45+
*/
46+
47+
// Generated from Schema Intro_Common
48+
49+
/*
50+
*/
51+
52+
namespace GqlPlus.Model_Schema_Intro_Common;
53+
54+
public interface IOutput_Type {}
55+
56+
public interface IOutput_BaseType {}
57+
58+
public interface IOutput_ChildType {}
59+
60+
public interface IOutput_ParentType {}
61+
62+
public enum _SimpleKind
63+
{
64+
Basic,
65+
Enum,
66+
Internal,
67+
Domain,
68+
Union,
69+
}
70+
71+
public enum _TypeKind
72+
{
73+
Basic = _SimpleKind.Basic,,
74+
Enum = _SimpleKind.Enum,,
75+
Internal = _SimpleKind.Internal,,
76+
Domain = _SimpleKind.Domain,,
77+
Union = _SimpleKind.Union,,
78+
Dual,
79+
Input,
80+
Output,
81+
}
82+
83+
public interface IOutput_TypeRef {}
84+
85+
public interface IOutput_TypeSimple {}

0 commit comments

Comments
 (0)