Skip to content

Commit 97a13db

Browse files
committed
Bump test coverage
1 parent e4b0adf commit 97a13db

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/Microsoft.OpenApi.Tests/Extensions/OpenApiTypeMapperTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,36 @@ public class OpenApiTypeMapperTests
1515
public static IEnumerable<object[]> PrimitiveTypeData => new List<object[]>
1616
{
1717
new object[] { typeof(int), new OpenApiSchema { Type = "integer", Format = "int32" } },
18+
new object[] { typeof(decimal), new OpenApiSchema { Type = "number", Format = "double" } },
19+
new object[] { typeof(bool?), new OpenApiSchema { Type = "boolean", Nullable = true } },
20+
new object[] { typeof(Guid), new OpenApiSchema { Type = "string", Format = "uuid" } },
21+
new object[] { typeof(uint), new OpenApiSchema { Type = "integer", Format = "int32" } },
22+
new object[] { typeof(long), new OpenApiSchema { Type = "integer", Format = "int64" } },
23+
new object[] { typeof(ulong), new OpenApiSchema { Type = "integer", Format = "int64" } },
1824
new object[] { typeof(string), new OpenApiSchema { Type = "string" } },
1925
new object[] { typeof(double), new OpenApiSchema { Type = "number", Format = "double" } },
2026
new object[] { typeof(float?), new OpenApiSchema { Type = "number", Format = "float", Nullable = true } },
27+
new object[] { typeof(byte?), new OpenApiSchema { Type = "string", Format = "byte", Nullable = true } },
28+
new object[] { typeof(int?), new OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } },
29+
new object[] { typeof(uint?), new OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } },
30+
new object[] { typeof(DateTimeOffset?), new OpenApiSchema { Type = "string", Format = "date-time", Nullable = true } },
31+
new object[] { typeof(double?), new OpenApiSchema { Type = "number", Format = "double", Nullable = true } },
32+
new object[] { typeof(char?), new OpenApiSchema { Type = "string", Nullable = true } },
2133
new object[] { typeof(DateTimeOffset), new OpenApiSchema { Type = "string", Format = "date-time" } }
2234
};
2335

2436
public static IEnumerable<object[]> OpenApiDataTypes => new List<object[]>
2537
{
2638
new object[] { new OpenApiSchema { Type = "integer", Format = "int32"}, typeof(int) },
39+
new object[] { new OpenApiSchema { Type = "number", Format = "decimal"}, typeof(decimal) },
40+
new object[] { new OpenApiSchema { Type = "number", Format = null, Nullable = false}, typeof(double) },
2741
new object[] { new OpenApiSchema { Type = "integer", Format = null, Nullable = false}, typeof(int) },
2842
new object[] { new OpenApiSchema { Type = "integer", Format = null, Nullable = true}, typeof(int?) },
43+
new object[] { new OpenApiSchema { Type = "number", Format = "decimal", Nullable = true}, typeof(decimal?) },
44+
new object[] { new OpenApiSchema { Type = "number", Format = "double", Nullable = true}, typeof(double?) },
45+
new object[] { new OpenApiSchema { Type = "string", Format = "date-time", Nullable = true}, typeof(DateTimeOffset?) },
46+
new object[] { new OpenApiSchema { Type = "string", Format = "char", Nullable = true}, typeof(char?) },
47+
new object[] { new OpenApiSchema { Type = "string", Format = "uuid", Nullable = true}, typeof(Guid?) },
2948
new object[] { new OpenApiSchema { Type = "string" }, typeof(string) },
3049
new object[] { new OpenApiSchema { Type = "number", Format = "double" }, typeof(double) },
3150
new object[] { new OpenApiSchema { Type = "number", Format = "float", Nullable = true }, typeof(float?) },

0 commit comments

Comments
 (0)