Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added long awaited test
  • Loading branch information
UlrikSandberg committed Feb 19, 2025
commit f11240a1b770f9c618f88f604e290adc819be276
32 changes: 32 additions & 0 deletions test/LEGO.AsyncAPI.Tests/AsyncApiDocumentV2Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1325,5 +1325,37 @@ public void Serializev2_WithBindings_Serializes()

Assert.AreEqual("this mah binding", httpBinding.Headers.Description);
}



[Test]
public void SerializeV2_EmptyChannelObject_DeserializeAndSerializePreserveChannelObject()
{
// Arrange
var spec = """
asyncapi: 2.6.0
info:
title: Spec with missing channel info
description: test description
servers:
production:
url: example.com
protocol: pulsar+ssl
description: test description
channels: { }
""";

var settings = new AsyncApiReaderSettings();
settings.Bindings = BindingsCollection.All;
var reader = new AsyncApiStringReader(settings);

// Act
var deserialized = reader.Read(spec, out var diagnostic);
var actual = deserialized.Serialize(AsyncApiVersion.AsyncApi2_0, AsyncApiFormat.Yaml);

// Assert
actual.Should()
.BePlatformAgnosticEquivalentTo(spec);
}
}
}
Loading