Skip to content

Commit

Permalink
Add in a test to cover the const keyword in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
crudbee committed Jul 24, 2023
1 parent 7d953f3 commit 2b036a6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/LEGO.AsyncAPI.Tests/Models/AsyncApiSchema_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public class AsyncApiSchema_Should
},
},
},
["property9"] = new AsyncApiSchema
{
Const = new AsyncApiString("aSpecialConstant"),
},
},
Nullable = true,
ExternalDocs = new AsyncApiExternalDocumentation
Expand Down Expand Up @@ -245,7 +249,7 @@ public class AsyncApiSchema_Should
@"asyncapi: '2.6.0'
info:
title: Streetlights Kafka API
version: 1.0.0
version: '1.0.0'
description: The Smartylighting Streetlights API allows you to remotely manage the city lights.
license:
name: Apache 2.0
Expand Down Expand Up @@ -281,7 +285,7 @@ public class AsyncApiSchema_Should
@"asyncapi: '2.6.0'
info:
title: Streetlights Kafka API
version: 1.0.0
version: '1.0.0'
description: The Smartylighting Streetlights API allows you to remotely manage the city lights.
license:
name: Apache 2.0
Expand Down Expand Up @@ -418,6 +422,9 @@ public void SerializeAsJson_WithAdvancedSchemaObject_V2Works()
}
}
}
},
""property9"": {
""const"": ""aSpecialConstant""
}
},
""nullable"": true,
Expand Down Expand Up @@ -478,6 +485,9 @@ public void Deserialize_WithAdditionalProperties_Works()
}
}
}
},
""property9"": {
""const"": ""aSpecialConstant""
}
},
""nullable"": true,
Expand Down Expand Up @@ -596,7 +606,7 @@ public void Serialize_WithInliningOptions_ShouldInlineAccordingly(bool shouldInl
{ "testD", new AsyncApiSchema { Reference = new AsyncApiReference { Type = ReferenceType.Schema, Id = "testD" } } },
},
})
.WithComponent("testB", new AsyncApiSchema() { Description = "test", Type = SchemaType.Boolean })
.WithComponent("testB", new AsyncApiSchema() { Description = "test", Type = SchemaType.Boolean })
.Build();

var outputString = new StringWriter(CultureInfo.InvariantCulture);
Expand Down

0 comments on commit 2b036a6

Please sign in to comment.