Ejemplo n.º 1
0
        public void ArrayItemsChangedAndAddedAndRemovedWithNull()
        {
            var data1 = new ArrayItemData {
                Data = new [] { new Item("1"), new Item("2"), new Item("3") }
            };
            var data2 = new ArrayItemData {
                Data = new [] { null, new Item("2"), new Item("three"), new Item("4") }
            };

            AssertAreEqual("<Item>1</Item>,<Item>3</Item>,", data1, data2);
            AssertAreEqual(",<Item>three</Item>,<Item>4</Item>", data2, data1);
        }
Ejemplo n.º 2
0
        public void ArrayItemRemovedWithNull()
        {
            var data1 = new ArrayItemData {
                Data = new [] { new Item("foo") }
            };
            var data2 = new ArrayItemData {
                Data = new Item[] { null }
            };

            AssertAreEqual("<Item>foo</Item>", data1, data2);
            AssertAreEqual("", data2, data1);
        }
Ejemplo n.º 3
0
        public void ArrayItemsChanged()
        {
            var data1 = new ArrayItemData {
                Data = new [] { new Item("1"), new Item("2"), new Item("3") }
            };
            var data2 = new ArrayItemData {
                Data = new [] { new Item("a"), new Item("b"), new Item("c") }
            };

            AssertAreEqual("<Item>1</Item>,<Item>2</Item>,<Item>3</Item>", data1, data2);
            AssertAreEqual("<Item>a</Item>,<Item>b</Item>,<Item>c</Item>", data2, data1);
        }
Ejemplo n.º 4
0
        public void ArrayItems()
        {
            var data = new ArrayItemData {
                Text   = new[] { "one", "two", "three" },
                Number = new[] { 1, 2, 3 }
            };

            Assert.IsTrue(Matches(data, text == "two"));
            Assert.IsTrue(Matches(data, text.Contains("ee")));
            Assert.IsTrue(Matches(data, text.Contains("t")));
            Assert.IsTrue(Matches(data, text.Exists(true)));
            Assert.IsFalse(Matches(data, text.Exists(false)));
            Assert.IsTrue(Matches(new ArrayItemData(), text.Exists(false)));
            Assert.IsFalse(Matches(new ArrayItemData(), text.Exists(true)));
            Assert.IsTrue(Matches(data, number < "4"));
            Assert.IsTrue(Matches(data, number < "3"));
            Assert.IsTrue(Matches(data, number < "2"));
            Assert.IsFalse(Matches(data, number < "1"));
        }
Ejemplo n.º 5
0
 public void ArrayItems ()
 {
     var data = new ArrayItemData {
         Text = new[] { "one", "two", "three" },
         Number = new[] { 1, 2, 3 }
     };
     Assert.IsTrue (Matches (data, text == "two"));
     Assert.IsTrue (Matches (data, text.Contains ("ee")));
     Assert.IsTrue (Matches (data, text.Contains ("t")));
     Assert.IsTrue (Matches (data, text.Exists (true)));
     Assert.IsFalse (Matches (data, text.Exists (false)));
     Assert.IsTrue (Matches (new ArrayItemData (), text.Exists (false)));
     Assert.IsFalse (Matches (new ArrayItemData (), text.Exists (true)));
     Assert.IsTrue (Matches (data, number < "4"));
     Assert.IsTrue (Matches (data, number < "3"));
     Assert.IsTrue (Matches (data, number < "2"));
     Assert.IsFalse (Matches (data, number < "1"));
 }