Skip to content

Commit b8dbf98

Browse files
authored
Update OpenApiDocumentTests.cs
1 parent 98fa6f5 commit b8dbf98

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,17 @@ public void TagsSupportsCustomComparer()
21452145
Assert.Equal(2, document.Tags.Count);
21462146
}
21472147

2148+
[Fact]
2149+
public void TagsCanBeReInitializedToNull()
2150+
{
2151+
var document = new OpenApiDocument();
2152+
Assert.Null(document.Tags);
2153+
document.Tags = new HashSet<OpenApiTag>();
2154+
Assert.NotNull(document.Tags);
2155+
document.Tags = null;
2156+
Assert.Null(document.Tags);
2157+
}
2158+
21482159
private sealed class CaseInsensitiveOpenApiTagEqualityComparer : IEqualityComparer<OpenApiTag>
21492160
{
21502161
public bool Equals(OpenApiTag x, OpenApiTag y)

0 commit comments

Comments
 (0)