public void GetItemLocationWhenWindowPositionChanges() { WindowItemsMap windowsItemsMap = WindowItemsMap.Create(InitializeOption(), new Point(20, 20)); windowsItemsMap.Add(new Point(27, 27), SearchCriteria.ByAutomationId("foo")); windowsItemsMap.Save(); windowsItemsMap = WindowItemsMap.Create(InitializeOption(), new Point(5, 5)); Assert.Equal(new Point(12, 12), windowsItemsMap.GetItemLocation(SearchCriteria.ByAutomationId("foo"))); windowsItemsMap.CurrentWindowPosition = new Point(10, 10); Assert.Equal(new Point(17, 17), windowsItemsMap.GetItemLocation(SearchCriteria.ByAutomationId("foo"))); }
public virtual void Dispose() { windowItemsMap.Save(); }