Skip to content

Commit b61edcf

Browse files
committed
Updated diagram test to cover more scenarios
1 parent e0d08f8 commit b61edcf

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.VerifyDiagramFromSampleOpenAPI.verified.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ classDef DELETE_GET_PUT fill:olive,stroke:#333,stroke-width:2px
88
classDef DELETE_GET fill:DarkSeaGreen,stroke:#333,stroke-width:2px
99
classDef DELETE fill:Tomato,stroke:#333,stroke-width:2px
1010
classDef OTHER fill:White,stroke:#333,stroke-width:2px
11-
/["/"] --> /houses["houses"]
12-
class /houses OTHER
13-
/["/"] --> /cars["cars"]
14-
class /cars OTHER
15-
class / OTHER
11+
/["/"] --> /houses("houses")
12+
class /houses GET_POST
13+
/["/"] --> /cars>"cars"]
14+
class /cars POST
15+
class / GET

test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,27 @@ public class OpenApiUrlTreeNodeTests
1919
{
2020
Paths = new OpenApiPaths()
2121
{
22-
["/"] = new OpenApiPathItem(),
23-
["/houses"] = new OpenApiPathItem(),
22+
["/"] = new OpenApiPathItem() {
23+
Operations = new Dictionary<OperationType, OpenApiOperation>()
24+
{
25+
[OperationType.Get] = new OpenApiOperation(),
26+
}
27+
},
28+
["/houses"] = new OpenApiPathItem()
29+
{
30+
Operations = new Dictionary<OperationType, OpenApiOperation>()
31+
{
32+
[OperationType.Get] = new OpenApiOperation(),
33+
[OperationType.Post] = new OpenApiOperation()
34+
}
35+
},
2436
["/cars"] = new OpenApiPathItem()
37+
{
38+
Operations = new Dictionary<OperationType, OpenApiOperation>()
39+
{
40+
[OperationType.Post] = new OpenApiOperation()
41+
}
42+
}
2543
}
2644
};
2745

0 commit comments

Comments
 (0)