Browse Source

Fixed failing tests.

pull/504/head
Steven Kirk 11 years ago
parent
commit
d1fcb2f5a6
  1. 2
      src/Perspex.Controls/Primitives/SelectingItemsControl.cs
  2. 4
      tests/Perspex.Controls.UnitTests/Primitives/SelectingItemsControlTests_Multiple.cs

2
src/Perspex.Controls/Primitives/SelectingItemsControl.cs

@ -235,7 +235,7 @@ namespace Perspex.Controls.Primitives
set set
{ {
if (value.IsFixedSize || value.IsReadOnly) if (value?.IsFixedSize == true || value?.IsReadOnly == true)
{ {
throw new NotSupportedException( throw new NotSupportedException(
"Cannot use a fixed size or read-only collection as SelectedItems."); "Cannot use a fixed size or read-only collection as SelectedItems.");

4
tests/Perspex.Controls.UnitTests/Primitives/SelectingItemsControlTests_Multiple.cs

@ -57,7 +57,7 @@ namespace Perspex.Controls.UnitTests.Primitives
}; };
target.ApplyTemplate(); target.ApplyTemplate();
target.SelectedItems = new[] { "bar" }; target.SelectedItems = new PerspexList<object>("bar");
Assert.Equal(1, target.SelectedIndex); Assert.Equal(1, target.SelectedIndex);
} }
@ -536,7 +536,7 @@ namespace Perspex.Controls.UnitTests.Primitives
target.ApplyTemplate(); target.ApplyTemplate();
target.Presenter.ApplyTemplate(); target.Presenter.ApplyTemplate();
target.SelectedItems = new[] { "foo", "baz" }; target.SelectedItems = new PerspexList<object>("foo", "baz");
Assert.True(called); Assert.True(called);
} }

Loading…
Cancel
Save