What is the correct syntax for mock.Verify for a protected setup?

I have the following unit test: [TestMethod] public async Task ShouldGetExperimentalValuePost() { //arrange var avd = ActualVesselData.Parser.ParseJson(File.ReadAllText(".\\TestFiles\\ActualVesselData-TTN-online.json")); const string mlOutputForTestAvd = "{\"timestampAfterEpochMillis\": 1686235071742, \"raw_prediction\": 2.6, \"prediction\": 5.22, \"optimal_prediction\": 5.22, \"version_offline\": 38}"; var mockMessageHandler = new Mock<HttpMessageHandler>(); mockMessageHandler.Protected() .Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>()) .ReturnsAsync(new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(mlOutputForTestAvd) }); var mlClient = new… Read More What is the correct syntax for mock.Verify for a protected setup?

Typescript return union "either or" throws property not found error

I’m trying to write a Typescript helper function that returns a valid either/or type but I’m not understanding how to appease the compiler. My types are defined as follows: export interface MediaElementUrl { media_type: ‘image’ | ‘video’; url: string; attachment_id: never; buttons?: Button[]; } export interface MediaElementAttachmentId { media_type: ‘image’ | ‘video’; url: never; attachment_id:… Read More Typescript return union "either or" throws property not found error

Is there a more idiomatic way to specialise behaviour using flags passed via template?

Apologises for the ambiguous title. Here is my code: struct LowHigh { }; struct HighLow { }; template < class LookupScheme> struct ladder_base { using value_type = price_depth; using ladder_type = std::vector< value_type >; template < class T > struct lookup; template <> struct lookup< LowHigh > { static constexpr auto func = std::upper_bound< ladder_type::iterator,… Read More Is there a more idiomatic way to specialise behaviour using flags passed via template?