public LineItem(AutomationElement handle) { this.handle = handle; var texts = handle.FindAll(TreeScope.Children, new PropertyCondition(AutomationElement.ClassNameProperty, "TextBlock")).Cast <AutomationElement>().ToArray(); this.Quantity = int.Parse(texts[0].Current.Name); this.CardName = texts[1].Current.Name; Legal = PennyDreadfulLegality.IsLegal(CardName); }
//[Test] public void TestAccents() { var match = new MockMatch(); var legality = new PennyDreadfulLegality(); Assert.IsTrue(legality.IsCardLegal(CardName.FixAccents("Dandan"))); //Assert.IsTrue(legality.IsCardLegal(CardName.FixAccents("Junún Efreet"))); Assert.IsTrue(legality.IsCardLegal(CardName.FixAccents("DandAþn"))); Assert.IsFalse(legality.IsCardLegal(CardName.FixAccents("Lim-dl"))); }