Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra test methods #1

Open
LockTar opened this issue Nov 2, 2022 · 0 comments
Open

Extra test methods #1

LockTar opened this issue Nov 2, 2022 · 0 comments

Comments

@LockTar
Copy link

LockTar commented Nov 2, 2022

Hi,

Here are some extra test methods for issue 936. See my comment.

// Bug???
[Function("ThrowExceptionVoid")]
public void ThrowExceptionVoid(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "throw-exception-void")] HttpRequestData req)
    => throw new System.Exception("Test message");

// Bug???
[Function("ThrowExceptionTask")]
public Task ThrowExceptionTask(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "throw-exception-task")] HttpRequestData req)
    => throw new System.Exception("Test message");

// Correct expected behavoir
[Function("ThrowExceptionAndReturn")]
public MyResponseType ThrowExceptionAndReturn(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "throw-exception-and-return/{returnUsefullData}")] HttpRequestData req,
    bool returnUsefullData)
    => returnUsefullData
        ? throw new System.Exception("Test message")
        : new MyResponseType();

// Correct expected behavoir
[Function("ThrowExceptionHttpResponseData")]
public HttpResponseData ThrowExceptionHttpResponseData(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "throw-exception-httpresponsedata")] HttpRequestData req)
    => throw new System.Exception("Test message");

// Correct expected behavoir
[Function("ThrowExceptionTaskHttpResponseData")]
public Task<HttpResponseData> ThrowExceptionTaskHttpResponseData(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "throw-exception-task-httpresponsedata")] HttpRequestData req)
    => throw new System.Exception("Test message");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant