Exemple #1
0
        public void TestMethod_Set4()
        {
            TestBaseList.Add(Item1);
            TestBaseList.Add(Item2);
            TestBaseList.Add(Item3);

            ListAdapter = new ObservableListAdapterConcrete(TestBaseList);

            Assert.That(ListAdapter.Count, Is.EqualTo(3));
            Assert.That(Item1, Is.EqualTo(ListAdapter.First().BaseString));
            Assert.That(Item2, Is.EqualTo(ListAdapter[1].BaseString));
            Assert.That(Item3, Is.EqualTo(ListAdapter[2].BaseString));
            Assert.That(Item1 + ListAdapter.First().AddedString, Is.EqualTo(ListAdapter.First().StringView));
        }
Exemple #2
0
        public void TestMethod_SetConstructorAndAdd()
        {
            ListAdapter = new ObservableListAdapterConcrete(TestBaseList);

            TestBaseList.PropertyChanged   += (sender, args) => AssertEvent.Call("PropertyChanged");
            TestBaseList.CollectionChanged += (sender, args) => AssertEvent.Call("CollectionChanged");

            TestBaseList.Add(Item1);
            TestBaseList.Add(Item2);
            TestBaseList.Add(Item3);

            Assert.That(ListAdapter.Count, Is.EqualTo(3));
            Assert.That(Item1, Is.EqualTo(ListAdapter.First().BaseString));
            Assert.That(Item2, Is.EqualTo(ListAdapter[1].BaseString));
            Assert.That(Item3, Is.EqualTo(ListAdapter[2].BaseString));
            Assert.That(Item1 + ListAdapter.First().AddedString, Is.EqualTo(ListAdapter.First().StringView));

            MockEvent.Verify(m => m.Call("PropertyChanged"), Times.Exactly(6));
            MockEvent.Verify(m => m.Call("CollectionChanged"), Times.Exactly(3));
        }