public CommandMoveOnDI(Axis[] axes, MovePosPrm[] movePosPrms, DI d, StsType stsType) : base(axes) { this.MovePosPrms = movePosPrms; this.DI = d; this.StsType = stsType; }
public static Sts CreateSts(StsType stsType) { Sts sts; switch (stsType) { case StsType.ADFS: sts = new AdfsSts(); break; case StsType.AADFederatedWithADFS3: sts = new AadFederatedWithAdfs3Sts(); break; case StsType.AAD: sts = new AadSts(); break; case StsType.AdfsPasswordGrant: sts = new AdfsPasswordGrantSts(); break; case StsType.AadPasswordGrant: sts = new AadPasswordGrantSts(); break; default: throw new ArgumentException(string.Format("Unsupported STS type '{0}'", stsType)); } return sts; }
public void TestMethodSetup() { AdalTests.InitializeTest(); StsType stsType = this.GetStsTypeFromContext(); Sts = SetupStsService(stsType); }
public static Sts CreateSts(StsType stsType) { Sts sts; switch (stsType) { case StsType.ADFS: sts = new AdfsSts(); break; case StsType.AADFederatedWithADFS3: sts = new AadFederatedWithAdfs3Sts(); break; case StsType.AAD: sts = new AadSts(); break; case StsType.AdfsPasswordGrant: sts = new AdfsPasswordGrantSts(); break; case StsType.AadPasswordGrant: sts = new AadPasswordGrantSts(); break; default: throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, " Unsupported STS type '{0}'", stsType)); } return(sts); }
internal void VerifySingleItemInCache(AuthenticationResultProxy result, StsType stsType) { List <TokenCacheItem> items = this.context.TokenCache.ReadItems().ToList(); Verify.AreEqual(1, items.Count); Verify.AreEqual(result.AccessToken, items[0].AccessToken); Verify.AreEqual(result.IdToken ?? string.Empty, items[0].IdToken ?? string.Empty); Verify.IsTrue(stsType == StsType.ADFS || items[0].IdToken != null); }
internal void VerifySingleItemInCache(AuthenticationResultProxy result, StsType stsType) { List<TokenCacheItem> items = this.context.TokenCache.ReadItems().ToList(); Verify.AreEqual(1, items.Count); Verify.AreEqual(result.AccessToken, items[0].AccessToken); Verify.AreEqual(result.RefreshToken, items[0].RefreshToken); Verify.AreEqual(result.IdToken, items[0].IdToken); Verify.IsTrue(stsType == StsType.ADFS || items[0].IdToken != null); }
protected static Sts SetupStsService(StsType stsType) { Sts sts; if (!StsDictionary.TryGetValue(stsType, out sts)) { sts = StsFactory.CreateSts(stsType); StsDictionary.Add(stsType, sts); } return sts; }
protected static Sts SetupStsService(StsType stsType) { Sts sts; if (!StsDictionary.TryGetValue(stsType, out sts)) { sts = StsFactory.CreateSts(stsType); StsDictionary.Add(stsType, sts); } return(sts); }
public void TestMethodSetup() { AdalTests.InitializeTest(); StsType stsType = this.GetStsTypeFromContext(); try { AuthenticationContextProxy.CallSync = bool.Parse((string)TestContext.DataRow["CallSync"]); } catch (ArgumentException) { AuthenticationContextProxy.CallSync = false; } Sts = SetupStsService(stsType); RecorderSettings.SetMockModeByTestContext(TestContext); AdalTests.EndBrowserDialogSession(); }
public static Sts CreateSts(StsType stsType) { Sts sts; switch (stsType) { case StsType.ADFS: sts = new AdfsSts(); break; case StsType.AADFederatedWithADFS3: sts = new AadFederatedWithAdfs3Sts(); break; case StsType.AAD: sts = new AadSts(); break; default: throw new ArgumentException(string.Format("Unsupported STS type '{0}'", stsType)); } return sts; }
public static Sts CreateSts(StsType stsType) { Sts sts = null; if (stsType == StsType.ADFS) { sts = new AdfsSts(); } else if (stsType == StsType.AADFederatedWithADFS3) { sts = new AadFederatedWithAdfs3Sts(); } else if (stsType == StsType.AAD) { sts = new AadSts(); } else { throw new ArgumentException(string.Format("Unsupported STS type '{0}'", stsType)); } return(sts); }
public bool Is(StsType stsType) { bool b = false; switch (stsType) { case StsType.IsRising: b = this.IsRising; break; case StsType.IsFalling: b = this.IsFalling; break; case StsType.High: b = this.Value; break; case StsType.Low: b = !this.Value; break; } return(b); }
internal void VerifySingleItemInCache(AuthenticationResultProxy result, StsType stsType) { }
private async Task RunTestAsync(TestMethodAsync testMethodAsync, StsType stsType = StsType.AAD) { await this.RunTestSyncOrAsync(NullTestMethod, testMethodAsync, stsType); }
private void RunTest(TestMethod testMethod, StsType stsType = StsType.AAD) { this.RunTestSyncOrAsync(testMethod, NullTestMethodAsync, stsType).Wait(); }
public CommandMoveOnDI(Axis axis, MovePosPrm movePosPrm, DI d, StsType stsType) : this(new Axis[] { axis }, new MovePosPrm[] { movePosPrm }, d, stsType) { }
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); } }