I need to mock the DeleteEntityAsync
method of TableClient
.
CodePudding user response:
I'm working on the same thing. Try this:
var mockResponse = new Mock<Response>();
mockResponse.SetupGet(x => x.Status).Returns((int)HttpStatusCode.NotFound);
mockResponse.SetupGet(x => x.Content).Returns(BinaryData.FromString("data source here"));
tableClient.Setup(x => x.DeleteEntityAsync(It.IsAny<string>(), It.IsAny<string>(), default, default)).ReturnsAsync(mockResponse.Object);