Obel
Obel
CC#
Created by Obel on 8/21/2023 in #help
ProblemDetails and FluentValidation
Yes thank you, i found the solution. And it was exactly this approach! 🙂
5 replies
CC#
Created by Obel on 8/21/2023 in #help
ProblemDetails and FluentValidation
I've set up fluent validation using the documentation from here -> https://docs.fluentvalidation.net/en/latest/aspnet.html
5 replies
CC#
Created by Obel on 8/21/2023 in #help
ProblemDetails and FluentValidation
As of now i get an Internal server Error when i try to force the error by requesting with bad data
5 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
Mmh i see, its not easy getting into. I think i might start from scratch to try and get a better understanding
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
Thats what im saying too. I think i got overwhelmed with this way of having to mock and test functionality, that i tried something without completely understanding what it was doing
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
Should i try a totally different approach, and just try to discard this one i have? Is there an easier way of unit testing functionality?
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
Its supposed to return the result from the httpResponseMessage, which is made just above. Which should be a token
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
Im not used to testing, its my first time trying to test real functionality
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
Right because im faking the Token in my expected result right, and then the _loginService calls the Login function which actually contacts a URL
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
And yes its Json data being sent
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
And i've found another github that also uses a mock approach, it looks different tho, and i have a hard time figuring out what would work and what doesnt
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
I have been using chatgpt and copilot, for guidance on how to mock Httpclient and basicly testing in general
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
I want my expectedResult to have a token, and then when i do the call for the actual value, that should also include a token
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
It says that the HttpRequestMessage request is null, im not sure how or if i can populate it with values?
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
The error is produced here
_httpClient.SendAsync(It.IsAny<HttpRequestMessage>(), default)
_httpClient.SendAsync(It.IsAny<HttpRequestMessage>(), default)
25 replies
CC#
Created by Obel on 7/20/2023 in #help
HttpRequestMessage request cannot be null, TESTING
25 replies
CC#
Created by Obel on 7/19/2023 in #help
Delegate type mismatch
Ye i thought it would something wrong with the values being set incorrectly, thanks i'll have a look at it
21 replies
CC#
Created by Obel on 7/19/2023 in #help
Delegate type mismatch
My login function works fine in Swagger
21 replies
CC#
Created by Obel on 7/19/2023 in #help
Delegate type mismatch
And that comes from the _httpClient.SendAsync
21 replies