Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,563 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
here is my code:
var uploadSession = await graphServiceClient.Drives[driveId]
.Items["root"]
.ItemWithPath(fileName)
.CreateUploadSession
.PostAsync(uploadSessionRequestBody);
the above code works, but I am not able to mock the call properly to make my tests pass.
when calling ItemWithPath I get an Exception:
Invalid URI: The hostname could not be parsed.
this exception happens deep in the graph code and I have no clue how to mock these tests. rootRequestBuilder.ToGetRequestInformation().URI.OriginalString is not a valid parameter for newUriBuilder(parameter) in the test environment.