hassanhabib/RESTFulSense

FEATURE: Create HTTP Errors Easily in `WebAssembly` Project

ElbekDeveloper opened this issue · 0 comments

Currently if you want to create exceptions for unit tests, when you are using WebAssembly library, you have to do the following:

public static TheoryData CriticalDependencyExceptions()
{
    string someMessage = GetRandomMessage();
    var someResponseMessage = new HttpResponseMessage();

    return new TheoryData<Xeption>()
    {
        new HttpResponseUrlNotFoundException(
            someResponseMessage,
            someMessage),

        new HttpResponseUnauthorizedException(
            someResponseMessage,
            someMessage),

        new HttpResponseForbiddenException(
            someResponseMessage,
            someMessage)
    };
}

At the same time Core project made it easier to create the above exceptions without response message and message.