public void DeriveWithSelectorMove()
 {
     var list = new RxList<string>("1", "2", "3");
     var derived = list.Derive(x => int.Parse(x));
     list.Move(0, 2);
     Assert.AreEqual(2, derived[0]);
     Assert.AreEqual(3, derived[1]);
     Assert.AreEqual(1, derived[2]);            
 }
Example #2
0
        public void MovedItem()
        {
            var list = new RxList<string>("1a", "2a");

            var item = new RxListMovedItem<string>();
            list.Moved.Subscribe(x => item = x);

            list.Move(1, "1a");
            Assert.AreEqual(0, item.FromIndex);
            Assert.AreEqual(1, item.ToIndex);
            Assert.AreEqual("1a", item.Value);
            Assert.AreEqual("2a", list[0]);
            Assert.AreEqual("1a", list[1]);
        }
Example #3
0
 public void MoveSameItem()
 {
     var list = new RxList<int>(1, 2, 3);
     list.Move(2, 2);
     Assert.AreEqual(3, list[2]);
 }
Example #4
0
 public void MoveDifferentItem()
 {
     var list = new RxList<int>(1, 2, 3);
     list.Move(1, 2);
     Assert.AreEqual(2, list[2]);
 }