Example #1
0
        private async Task TestProvisionApplicationAsync()
        {
            Uri successUri = new Uri("https://contoso.com/success?instanceid=3");

            _subBrowserAuthBroker
            .AuthenticateAsync(Arg.Is <Uri>(url => CheckStartUrlProvisionApplication(url)), Arg.Any <Uri>())
            .Returns(successUri);

            ShellAuthService service    = CreateService();
            string           instanceId = await service.ProvisionApplicationAsync(s_shellUrl, s_masterApplicationId, ApplicationCreationToken, ApplicationInstanceId);

            Assert.AreEqual("3", instanceId);
        }
Example #2
0
        public async Task WhenCallingAuthorizeAdditionalRecordsAsync_ThenBrowserUrlIsConstructedCorrectly()
        {
            Uri successUri = new Uri("https://contoso.com/success?instanceid=3");

            _subBrowserAuthBroker
            .AuthenticateAsync(Arg.Is <Uri>(url => CheckStartUrlAdditionalRecords(url)), Arg.Any <Uri>())
            .Returns(successUri);

            ShellAuthService service = CreateService();
            await service.AuthorizeAdditionalRecordsAsync(s_shellUrl, s_appInstanceId);

            await _subBrowserAuthBroker
            .Received()
            .AuthenticateAsync(Arg.Any <Uri>(), Arg.Any <Uri>());
        }