From 996407c3680a77c7419eeb9822756b8fcf025aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Derriey?= Date: Thu, 7 Mar 2024 08:18:12 +0100 Subject: [PATCH] Ensure leaf nodes have no children --- .../Services/OpenApiUrlTreeNodeTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs b/test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs index 5303d7390..4760cf37a 100644 --- a/test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs +++ b/test/Microsoft.OpenApi.Tests/Services/OpenApiUrlTreeNodeTests.cs @@ -495,8 +495,9 @@ public void SupportsTrailingSlashesInPath(string path, string[] childrenBeforeLa secondToLeafNode = secondToLeafNode.Children[childName]; } - Assert.True(secondToLeafNode.Children.TryGetValue(expectedLeafNodeName, out var lastNode)); - Assert.Equal(expectedLeafNodePath, lastNode.Path); + Assert.True(secondToLeafNode.Children.TryGetValue(expectedLeafNodeName, out var leafNode)); + Assert.Equal(expectedLeafNodePath, leafNode.Path); + Assert.Empty(leafNode.Children); } } }