mirror of
https://github.com/ysoftdevs/wapifuzz.git
synced 2026-03-28 20:21:55 +01:00
Added unit tests for both parser and fuzzer
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user