private IBroker CreateMockBroker() { IBroker mockBroker = Substitute.For <IBroker>(); mockBroker.CanInvokeBroker(null).ReturnsForAnyArgs(true); mockBroker.AcquireTokenUsingBrokerAsync(null).ReturnsForAnyArgs(TestConstants.CreateMsalTokenResponse()); return(mockBroker); }
private async Task <MsalTokenResponse> SendAndVerifyResponseAsync() { CreateRequestParametersForBroker(); MsalTokenResponse msalTokenResponse = await Broker.AcquireTokenUsingBrokerAsync(_brokerPayload).ConfigureAwait(false); ValidateResponseFromBroker(msalTokenResponse); return(msalTokenResponse); }