public void Start <TPage>(Underwriter userName, string password, Action <TPage> action) where TPage : UIPage { using (var driver = new WebDriverWrapper()) { AddRunningDriver(driver); driver.Configuration.UserName = userName.ToString(); driver.Configuration.UserPass = password; driver.BrowserStart(); try { var page = UIPage.CreatePage <TPage>(driver); action(page); } catch (Exception ex) { var screenshotFile = driver.TakeScreenshot(TestContext.CurrentContext.Test.MethodName); TestContext.AddTestAttachment(screenshotFile); throw ex; } finally { RemoveRunningDriver(driver); } } }
public override bool Equals(object obj) { var cpl = obj as FakeAgentDisplayRule; if (cpl == null) { return(false); } return(LetterType.Equals(cpl.LetterType) && TransactionPropertyState.Equals(cpl.TransactionPropertyState) && TransactionType.Equals(cpl.TransactionType) && Underwriter.Equals(cpl.Underwriter)); }
public override int GetHashCode() { unchecked { // Choose large primes to avoid hashing collisions const int hashingBase = (int)2166136261; const int hashingMultiplier = 16777619; int hash = hashingBase; hash = (hash * hashingMultiplier) ^ (!ReferenceEquals(null, LetterType) ? LetterType.GetHashCode() : 0); hash = (hash * hashingMultiplier) ^ (!ReferenceEquals(null, TransactionPropertyState) ? TransactionPropertyState.GetHashCode() : 0); hash = (hash * hashingMultiplier) ^ (!ReferenceEquals(null, TransactionType) ? TransactionType.GetHashCode() : 0); hash = (hash * hashingMultiplier) ^ (!ReferenceEquals(null, Underwriter) ? Underwriter.GetHashCode() : 0); return(hash); } }