Esempio n. 1
0
        public static void ConfigureMockWebUI(IPlatformProxy platformProxy, MockWebUI webUi)
        {
            IWebUIFactory mockFactory = Substitute.For <IWebUIFactory>();

            mockFactory.CreateAuthenticationDialog(Arg.Any <CoreUIParent>(), Arg.Any <RequestContext>()).Returns(webUi);
            platformProxy.SetWebUiFactory(mockFactory);
        }
        /// <summary>
        /// Configures a web ui that returns a succesfull result
        /// </summary>
        public static void ConfigureMockWebUI(IPublicClientApplication pca)
        {
            var       app   = pca as PublicClientApplication;
            MockWebUI webUi = new MockWebUI
            {
                MockResult = AuthorizationResult.FromUri(app.AppConfig.RedirectUri + "?code=some-code")
            };

            ConfigureMockWebUI(app.ServiceBundle.PlatformProxy, webUi);
        }
        public static void ConfigureMockWebUI(AuthorizationResult authorizationResult,
                                              Dictionary <string, string> queryParamsToValidate, string environment)
        {
            MockWebUI webUi = new MockWebUI
            {
                QueryParamsToValidate = queryParamsToValidate,
                MockResult            = authorizationResult,
                Environment           = environment
            };

            ConfigureMockWebUI(webUi);
        }
        /// <summary>
        /// Configures a web ui that returns a succesfull result
        /// </summary>
        public static void ConfigureMockWebUI(
            this IServiceBundle serviceBundle,
            IWebUI webUi = null)
        {
            if (webUi == null)
            {
                webUi = new MockWebUI
                {
                    MockResult = AuthorizationResult.FromUri(serviceBundle.Config.RedirectUri + "?code=some-code")
                };
            }

            ConfigureWebUiFactory(serviceBundle, webUi);
        }
Esempio n. 5
0
        public static void ConfigureMockWebUI(
            IPlatformProxy platformProxy,
            AuthorizationResult authorizationResult,
            Dictionary <string, string> queryParamsToValidate,
            string environment)
        {
            MockWebUI webUi = new MockWebUI
            {
                QueryParamsToValidate = queryParamsToValidate,
                MockResult            = authorizationResult,
                ExpectedEnvironment   = environment
            };

            ConfigureMockWebUI(platformProxy, webUi);
        }
        public static MockWebUI ConfigureMockWebUI(
            this IServiceBundle serviceBundle,
            AuthorizationResult authorizationResult,
            Dictionary <string, string> queryParamsToValidate = null,
            string environment = null)
        {
            MockWebUI webUi = new MockWebUI
            {
                QueryParamsToValidate = queryParamsToValidate ?? new Dictionary <string, string>(),
                MockResult            = authorizationResult,
                ExpectedEnvironment   = environment
            };

            ConfigureWebUiFactory(serviceBundle, webUi);

            return(webUi);
        }