Created
May 30, 2016 14:40
-
-
Save grokys/5dcffdeb1407de93a00c94ed3c7c5164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void Inserting_Items_Should_Update_Containers() | |
| { | |
| var target = CreateTarget(itemCount: 20); | |
| target.ApplyTemplate(); | |
| target.Measure(new Size(100, 95)); | |
| target.Arrange(new Rect(0, 0, 100, 95)); | |
| ((ILogicalScrollable)target).Offset = new Vector(0, 5); | |
| var expected = Enumerable.Range(5, 10).Select(x => $"Item {x}").ToList(); | |
| var items = (ObservableCollection<string>)target.Items; | |
| Assert.Equal( | |
| expected, | |
| target.Panel.Children.Select(x => x.DataContext)); | |
| items.Insert(6, "Inserted"); | |
| expected.Insert(1, "Inserted"); | |
| Assert.Equal( | |
| expected, | |
| target.Panel.Children.Select(x => x.DataContext)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment