Ejemplo n.º 1
0
        private async Task RunTestSyncOrAsync(TestMethod testMethod, TestMethodAsync testMethodAsync, StsType stsType)
        {
            this.AppendText(string.Format("{0}: ", (testMethod != NullTestMethod) ? testMethod.Method.Name : testMethodAsync.Method.Name));
            try
            {
                Sts sts = StsFactory.CreateSts(stsType);
                AdalTests.InitializeTest();
                AdalTests.EndBrowserDialogSession();
                if (testMethod != NullTestMethod)
                {
                    testMethod(sts);
                }

                if (testMethodAsync != NullTestMethodAsync)
                {
                    await testMethodAsync(sts);
                }

                this.AppendText("PASSED.\n", Color.Green);
            }
            catch (AssertFailedException)
            {
                this.AppendText("FAILED!\n", Color.Red);
            }
            catch (Exception ex)
            {
                this.AppendText(string.Format("FAILED with exception '{0}'!\n", ex), Color.Red);
            }
        }
        public async Task Create_DoesNotReturnNull()
        {
            var factory = new StsFactory();
            var result  = await factory.Create();

            Assert.That(result, Is.Not.EqualTo(null));
        }
Ejemplo n.º 3
0
        public MainPage()
        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            this.sts = StsFactory.CreateSts(StsType.AAD);
        }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            this.sts = StsFactory.CreateSts(StsType.AAD);

            this.fls = new FileLoggingSession("Test File Logging Session");
            this.fls.AddLoggingChannel(AdalTrace.AdalLoggingChannel, LoggingLevel.Verbose);

            this.ls = new LoggingSession("Test Logging Session");
            this.ls.AddLoggingChannel(AdalTrace.AdalLoggingChannel, LoggingLevel.Verbose);
        }