public static void FieldExpression_Parse_StatusCode() { var sut = OasFieldExpression.Parse("$statusCode"); Assert.Equal(OasFieldExpressionType.StatusCode, sut.ExpressionType); Assert.Equal("$statusCode", sut.ToString()); }
public static void FieldExpression_Parse_Method() { var sut = OasFieldExpression.Parse("$method"); Assert.Equal(OasFieldExpressionType.Method, sut.ExpressionType); Assert.Equal("$method", sut.ToString()); }
public static void FieldExpression_Parse_Url() { var sut = OasFieldExpression.Parse("$url"); Assert.Equal(OasFieldExpressionType.Url, sut.ExpressionType); Assert.Equal("$url", sut.ToString()); }
public static void FieldExpression_Parse_ResponseHeader() { var sut = OasFieldExpression.Parse("$response.header.foo"); Assert.Equal(OasFieldExpressionType.Response, sut.ExpressionType); Assert.Equal(OasFieldExpressionSource.Header, sut.ExpressionSource); Assert.Equal("foo", sut.Name); Assert.Equal("$response.header.foo", sut.ToString()); }
public static void FieldExpression_Parse_RequestBody() { var sut = OasFieldExpression.Parse("$request.body#/foo/bar"); Assert.Equal(OasFieldExpressionType.Request, sut.ExpressionType); Assert.Equal(OasFieldExpressionSource.Body, sut.ExpressionSource); Assert.Equal(JsonPointer.Parse("/foo/bar"), sut.Pointer); Assert.Equal("$request.body#/foo/bar", sut.ToString()); }
public static void FieldExpression_Parse_RequestPath() { var sut = OasFieldExpression.Parse("$request.path.foo"); Assert.Equal(OasFieldExpressionType.Request, sut.ExpressionType); Assert.Equal(OasFieldExpressionSource.Path, sut.ExpressionSource); Assert.Equal("foo", sut.Name); Assert.Equal("$request.path.foo", sut.ToString()); }
public static void FieldExpression_Parse_ResponseQuery() { var sut = OasFieldExpression.Parse("$response.query.foo"); Assert.Equal(OasFieldExpressionType.Response, sut.ExpressionType); Assert.Equal(OasFieldExpressionSource.Query, sut.ExpressionSource); Assert.Equal("foo", sut.Name); Assert.Equal("$response.query.foo", sut.ToString()); }