@@ -51,7 +51,7 @@ public void GetPathsForGraphBetaModelReturnsAllPaths()
51
51
52
52
// Assert
53
53
Assert . NotNull ( paths ) ;
54
- Assert . Equal ( 16354 , paths . Count ( ) ) ;
54
+ Assert . Equal ( 13836 , paths . Count ( ) ) ;
55
55
}
56
56
57
57
[ Fact ]
@@ -63,7 +63,8 @@ public void GetPathsForGraphBetaModelWithDerivedTypesConstraintReturnsAllPaths()
63
63
var settings = new OpenApiConvertSettings
64
64
{
65
65
RequireDerivedTypesConstraintForBoundOperations = true ,
66
- ExpandDerivedTypesNavigationProperties = false
66
+ ExpandDerivedTypesNavigationProperties = false ,
67
+ AppendBoundOperationsOnDerivedTypeCastSegments = true
67
68
} ;
68
69
69
70
// Act
@@ -81,7 +82,8 @@ public void GetPathsDoesntReturnPathsForCountWhenDisabled()
81
82
IEdmModel model = GetInheritanceModel ( string . Empty ) ;
82
83
ODataPathProvider provider = new ODataPathProvider ( ) ;
83
84
var settings = new OpenApiConvertSettings {
84
- EnableDollarCountPath = false ,
85
+ EnableDollarCountPath = false ,
86
+ AppendBoundOperationsOnDerivedTypeCastSegments = true
85
87
} ;
86
88
87
89
// Act
@@ -100,23 +102,35 @@ public void GetPathsDoesntReturnPathsForCountWhenDisabled()
100
102
</Annotation>" ;
101
103
102
104
[ Theory ]
103
- [ InlineData ( false , false , true , 3 ) ]
104
- [ InlineData ( false , false , false , 4 ) ]
105
- [ InlineData ( true , false , true , 7 ) ]
106
- [ InlineData ( true , false , false , 7 ) ]
107
- [ InlineData ( false , true , false , 5 ) ]
108
- [ InlineData ( false , true , true , 4 ) ]
109
- [ InlineData ( true , true , true , 8 ) ]
110
- [ InlineData ( true , true , false , 8 ) ]
111
- public void GetOperationPathsForModelWithDerivedTypesConstraint ( bool addAnnotation , bool getNavPropModel , bool requireConstraint , int expectedCount )
105
+ [ InlineData ( false , false , true , true , 3 ) ]
106
+ [ InlineData ( false , false , false , true , 4 ) ]
107
+ [ InlineData ( false , false , false , false , 3 ) ]
108
+ [ InlineData ( true , false , true , true , 7 ) ]
109
+ [ InlineData ( true , false , true , false , 6 ) ]
110
+ [ InlineData ( true , false , false , true , 7 ) ]
111
+ [ InlineData ( true , false , false , false , 6 ) ]
112
+ [ InlineData ( false , true , false , true , 5 ) ]
113
+ [ InlineData ( false , true , false , false , 4 ) ]
114
+ [ InlineData ( false , true , true , true , 4 ) ]
115
+ [ InlineData ( true , true , true , true , 8 ) ]
116
+ [ InlineData ( true , true , true , false , 7 ) ]
117
+ [ InlineData ( true , true , false , true , 8 ) ]
118
+ [ InlineData ( true , true , false , false , 7 ) ]
119
+ public void GetOperationPathsForModelWithDerivedTypesConstraint (
120
+ bool addAnnotation ,
121
+ bool getNavPropModel ,
122
+ bool requireConstraint ,
123
+ bool appendBoundOperationsOnDerivedTypes ,
124
+ int expectedCount )
112
125
{
113
126
// Arrange
114
127
var annotation = addAnnotation ? derivedTypeAnnotation : string . Empty ;
115
128
IEdmModel model = getNavPropModel ? GetNavPropModel ( annotation ) : GetInheritanceModel ( annotation ) ;
116
129
ODataPathProvider provider = new ( ) ;
117
130
var settings = new OpenApiConvertSettings
118
131
{
119
- RequireDerivedTypesConstraintForBoundOperations = requireConstraint
132
+ RequireDerivedTypesConstraintForBoundOperations = requireConstraint ,
133
+ AppendBoundOperationsOnDerivedTypeCastSegments = appendBoundOperationsOnDerivedTypes
120
134
} ;
121
135
122
136
// Act
@@ -130,23 +144,36 @@ public void GetOperationPathsForModelWithDerivedTypesConstraint(bool addAnnotati
130
144
Assert . Single ( dollarCountPathsWithCastSegment ) ;
131
145
}
132
146
[ Theory ]
133
- [ InlineData ( false , false , true , 4 ) ]
134
- [ InlineData ( false , false , false , 7 ) ]
135
- [ InlineData ( true , false , true , 7 ) ]
136
- [ InlineData ( true , false , false , 7 ) ]
137
- [ InlineData ( false , true , false , 8 ) ]
138
- [ InlineData ( false , true , true , 5 ) ]
139
- [ InlineData ( true , true , true , 8 ) ]
140
- [ InlineData ( true , true , false , 8 ) ]
141
- public void GetTypeCastPathsForModelWithDerivedTypesConstraint ( bool addAnnotation , bool getNavPropModel , bool requireConstraint , int expectedCount )
147
+ [ InlineData ( false , false , true , true , 4 ) ]
148
+ [ InlineData ( false , false , true , false , 3 ) ]
149
+ [ InlineData ( false , false , false , true , 7 ) ]
150
+ [ InlineData ( false , false , false , false , 6 ) ]
151
+ [ InlineData ( true , false , true , true , 7 ) ]
152
+ [ InlineData ( true , false , true , false , 6 ) ]
153
+ [ InlineData ( true , false , false , true , 7 ) ]
154
+ [ InlineData ( false , true , false , true , 8 ) ]
155
+ [ InlineData ( false , true , false , false , 7 ) ]
156
+ [ InlineData ( false , true , true , true , 5 ) ]
157
+ [ InlineData ( false , true , true , false , 4 ) ]
158
+ [ InlineData ( true , true , true , true , 8 ) ]
159
+ [ InlineData ( true , true , true , false , 7 ) ]
160
+ [ InlineData ( true , true , false , true , 8 ) ]
161
+ [ InlineData ( true , true , false , false , 7 ) ]
162
+ public void GetTypeCastPathsForModelWithDerivedTypesConstraint (
163
+ bool addAnnotation ,
164
+ bool getNavPropModel ,
165
+ bool requireConstraint ,
166
+ bool appendBoundOperationsOnDerivedTypes ,
167
+ int expectedCount )
142
168
{
143
169
// Arrange
144
170
var annotation = addAnnotation ? derivedTypeAnnotation : string . Empty ;
145
171
IEdmModel model = getNavPropModel ? GetNavPropModel ( annotation ) : GetInheritanceModel ( annotation ) ;
146
172
ODataPathProvider provider = new ( ) ;
147
173
var settings = new OpenApiConvertSettings
148
174
{
149
- RequireDerivedTypesConstraintForODataTypeCastSegments = requireConstraint
175
+ RequireDerivedTypesConstraintForODataTypeCastSegments = requireConstraint ,
176
+ AppendBoundOperationsOnDerivedTypeCastSegments = appendBoundOperationsOnDerivedTypes
150
177
} ;
151
178
152
179
// Act
0 commit comments