public virtual void RatingPeerGetNoItems() { Rating acc = new Rating(); acc.ItemsSource = null; RatingAutomationPeer peer = null; TestAsync( acc, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(acc) as RatingAutomationPeer, () => Assert.IsNull(peer.GetChildren(), "There should be no children when the Rating does not have items!")); }
public virtual void RatingPeerGetWithItems() { Rating view = new Rating(); view.ItemCount = 3; RatingAutomationPeer peer = null; List <AutomationPeer> items = null; TestAsync( view, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(view) as RatingAutomationPeer, () => items = peer.GetChildren(), () => Assert.AreEqual(3, items.Count, "Unexpected number of child peers!"), () => Assert.IsInstanceOfType(items[0], typeof(RatingItemAutomationPeer), "Child peer is not an RatingItemAutomationPeer!")); }