Skip to content

Commit ff7d5f6

Browse files
author
Jake Ginnivan
committed
Fixed #180
1 parent b1daffa commit ff7d5f6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/TestStack.White.UnitTests/Mappings/ControlDictionaryTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ public void GetTestControlType()
9898
Assert.Equal(typeof(TextBox), controlDictionary.GetTestControlType(string.Empty, string.Empty, ControlType.Edit, WindowsFramework.Silverlight.FrameworkId(), true));
9999
Assert.Equal(typeof(DateTimePicker), controlDictionary.GetTestControlType("SysDateTimePick32", string.Empty, ControlType.Pane, WindowsFramework.WinForms.FrameworkId(), true));
100100
Assert.Equal(typeof(DateTimePicker), controlDictionary.GetTestControlType("Winforms.SysDateTimePick32.ad8aa", string.Empty, ControlType.Pane, WindowsFramework.WinForms.FrameworkId(), true));
101+
Assert.Equal(typeof(Win32ListItem), controlDictionary.GetTestControlType(string.Empty, string.Empty, ControlType.ListItem, string.Empty, false));
102+
Assert.Equal(typeof(Win32ListItem), controlDictionary.GetTestControlType(string.Empty, string.Empty, ControlType.ListItem, WindowsFramework.WinForms.FrameworkId(), false));
103+
Assert.Equal(typeof(WPFListItem), controlDictionary.GetTestControlType(string.Empty, string.Empty, ControlType.ListItem, WindowsFramework.Wpf.FrameworkId(), false));
101104
}
102105

103106
[Fact]

src/TestStack.White/Mappings/ControlDictionary.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public virtual ControlType[] GetControlType(Type testControlType, string framewo
118118

119119
public virtual Type GetTestControlType(string className, string name, ControlType controlType, string frameWorkId, bool isNativeControl)
120120
{
121+
if (Equals(controlType, ControlType.ListItem) && string.IsNullOrEmpty(frameWorkId))
122+
frameWorkId = WindowsFramework.Win32.FrameworkId();
123+
121124
var dictionaryItems = items.Where(controlDictionaryItem =>
122125
{
123126
if (!ControlTypeMatches(controlType, controlDictionaryItem)) return false;

0 commit comments

Comments
 (0)