You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moq.MockException: Mock<BaseWebService:102>:
This mock failed verification due to the following:
BaseWebService x => x.HttpGet<bool>(It.Is<string>(url => url.Contains(string.Format("{0}/", controller)))):
This setup was not matched.
The bypass for me was changing the previous foreach into this:
Perhaps the following would be more appropriate: _mockWebService.Setup(x => x.HttpGet<bool>(It.IsRegex($"{controller}/", RegexOptions.IgnoreCase))).ReturnsAsync(false);
Perhaps the following would be more appropriate: _mockWebService.Setup(x => x.HttpGet<bool>(It.IsRegex($"{controller}/", RegexOptions.IgnoreCase))).ReturnsAsync(false);
You are right, but it worked as is in the previous release.
I upgraded Moq package from 4.16.1 to 4.20.69
I also use the latest .NET test packages under Visual Studio 2022
The setup for the _mockWebService is:
This code was working well, but is failing now:
The bypass for me was changing the previous foreach into this:
Should I avoid string interpolation at all in this case?
The text was updated successfully, but these errors were encountered: