Added unit tests for both parser and fuzzer

This commit is contained in:
Jan Stárek committed 2019-10-28 12:01:50 +01:00
1 parent 5d04195776
commit 01c9afaaca
3 files changed
+115

No files matched your search

@@ -19,6 +19,34 @@ namespace Parser.Tests
Assert.IsNull(parsedAttribute);
}
[Test]
public void ParsingPathAttributeWithPathLocation()
{
OpenApiParameter parameter = new OpenApiParameter
{
Schema = new OpenApiSchema { Type = "string", Format = null },
In = ParameterLocation.Path
};
var parsedAttribute = AttributeParser.ParseAttribute(parameter);
Assert.AreEqual("Path", parsedAttribute.Location);
}
[Test]
public void ParsingPathAttributeWithQueryLocation()
{
OpenApiParameter parameter = new OpenApiParameter
{
Schema = new OpenApiSchema { Type = "string", Format = null },
In = ParameterLocation.Query
};
var parsedAttribute = AttributeParser.ParseAttribute(parameter);
Assert.AreEqual("Query", parsedAttribute.Location);
}
[Test]
public void ParsingAttributeWithNoTypeOrFormatShouldReturnNull()
{