public void CanHandle_WithNoOpenApiKeyInDocument_ReturnsFalse() { string json = @"{ ""info"": { ""version"": ""v1"" }, ""paths"": { } }"; JObject jobject = JObject.Parse(json); OpenApiV3EndpointMetadataReader openApiV3EndpointMetadataReader = new OpenApiV3EndpointMetadataReader(); bool?result = openApiV3EndpointMetadataReader.CanHandle(jobject); Assert.False(result); }
public void CanHandle_WithOpenApiVersionGreaterThanThree_ReturnsFalse() { string json = @"{ ""openapi"": ""4.0.0"", ""info"": { ""version"": ""v1"" }, ""paths"": { } }"; JObject jobject = JObject.Parse(json); OpenApiV3EndpointMetadataReader openApiV3EndpointMetadataReader = new OpenApiV3EndpointMetadataReader(); bool?result = openApiV3EndpointMetadataReader.CanHandle(jobject); Assert.False(result); }
public void CanHandle_WithValidOpenApiVersionInDocument_ReturnsTrue() { string json = @"{ ""openapi"": ""3.0.0"", ""info"": { ""version"": ""v1"" }, ""paths"": { } }"; JObject jobject = JObject.Parse(json); OpenApiV3EndpointMetadataReader openApiV3EndpointMetadataReader = new OpenApiV3EndpointMetadataReader(); bool?result = openApiV3EndpointMetadataReader.CanHandle(jobject); Assert.True(result); }