Skip to content

Commit b1f06d7

Browse files
committed
Add test suite; update public API
1 parent e518515 commit b1f06d7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Microsoft.OpenApi.Interfaces;
1313
using Microsoft.OpenApi.Models;
1414
using Microsoft.OpenApi.Readers;
15+
using Microsoft.OpenApi.Services;
1516
using Microsoft.OpenApi.Writers;
1617
using VerifyXunit;
1718
using Xunit;
@@ -1344,9 +1345,10 @@ public void CopyConstructorForAdvancedDocumentWorks()
13441345
// Arrange & Act
13451346
var doc = new OpenApiDocument(AdvancedDocument);
13461347

1347-
// Change value of operation id for a given url
13481348
var docOpId = doc.Paths["/pets"].Operations[OperationType.Get].OperationId = "findAllMyPets";
13491349
var advancedDocOpId = AdvancedDocument.Paths["/pets"].Operations[OperationType.Get].OperationId;
1350+
var docResponse = doc.Paths["/pets"].Operations[OperationType.Get].Responses["200"].Description = "MyPet";
1351+
var advancedDocResponse = AdvancedDocument.Paths["/pets"].Operations[OperationType.Get].Responses["200"].Description;
13501352

13511353
// Assert
13521354
Assert.NotNull(doc.Info);
@@ -1355,6 +1357,7 @@ public void CopyConstructorForAdvancedDocumentWorks()
13551357
Assert.Equal(2, doc.Paths.Count);
13561358
Assert.NotNull(doc.Components);
13571359
Assert.NotEqual(docOpId, advancedDocOpId);
1360+
Assert.NotEqual(docResponse, advancedDocResponse);
13581361
}
13591362

13601363
[Fact]

test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ namespace Microsoft.OpenApi.Extensions
292292
public static T GetEnumFromDisplayName<T>(this string displayName) { }
293293
}
294294
}
295+
namespace Microsoft.OpenApi.Helpers
296+
{
297+
public class DictionaryCloneHelper
298+
{
299+
public DictionaryCloneHelper() { }
300+
public static System.Collections.Generic.Dictionary<T, U> Clone<T, U>(System.Collections.Generic.IDictionary<T, U> dictionary) { }
301+
}
302+
}
295303
namespace Microsoft.OpenApi.Interfaces
296304
{
297305
public interface IEffective<T>
@@ -587,6 +595,7 @@ namespace Microsoft.OpenApi.Models
587595
{
588596
protected OpenApiExtensibleDictionary() { }
589597
protected OpenApiExtensibleDictionary(System.Collections.Generic.Dictionary<string, T> dictionary = null, System.Collections.Generic.IDictionary<string, Microsoft.OpenApi.Interfaces.IOpenApiExtension> extensions = null) { }
598+
public System.Collections.Generic.IDictionary<string, T> Dictionary { get; set; }
590599
public System.Collections.Generic.IDictionary<string, Microsoft.OpenApi.Interfaces.IOpenApiExtension> Extensions { get; set; }
591600
public void SerializeAsV2(Microsoft.OpenApi.Writers.IOpenApiWriter writer) { }
592601
public void SerializeAsV3(Microsoft.OpenApi.Writers.IOpenApiWriter writer) { }

0 commit comments

Comments
 (0)