Esempio n. 1
0
 public static MockHttpMessageHandler AddAllMocks(this MockHttpManager httpManager, TokenResponseType aadResponse)
 {
     httpManager.AddInstanceDiscoveryMockHandler();
     return(AddTokenResponse(httpManager, aadResponse));
 }
 public static void AddInstanceDiscoveryMockHandler(this MockHttpManager httpManager, string url)
 {
     httpManager.AddMockHandler(MockHelpers.CreateInstanceDiscoveryMockHandler(MsalTestConstants.GetDiscoveryEndpoint(url)));
 }
 public static void AddMockHandlerSuccessfulClientCredentialTokenResponseMessage(this MockHttpManager httpManager)
 {
     httpManager.AddMockHandler(
         new MockHttpMessageHandler()
     {
         ExpectedMethod  = HttpMethod.Post,
         ResponseMessage = MockHelpers.CreateSuccessfulClientCredentialTokenResponseMessage()
     });
 }
 public static void AddInstanceDiscoveryMockHandler(this MockHttpManager httpManager)
 {
     AddInstanceDiscoveryMockHandler(httpManager, MsalTestConstants.AuthorityCommonTenant);
 }
        public static MockHttpMessageHandler AddMockHandlerSuccessfulClientCredentialTokenResponseMessage(this MockHttpManager httpManager)
        {
            var handler = new MockHttpMessageHandler()
            {
                ExpectedMethod  = HttpMethod.Post,
                ResponseMessage = MockHelpers.CreateSuccessfulClientCredentialTokenResponseMessage()
            };

            httpManager.AddMockHandler(handler);

            return(handler);
        }