Exemplo n.º 1
0
            public void Should_Match_Remove()
            {
                ToChange.Add("1");

                Assert.AreEqual(1, ToChange.Count);
                Assert.IsTrue(ToChange.Contains("1"));

                ListUtils.MatchListChanges(ToChange, ToMatch, n => n.ToString(), s => Int32.Parse(s));

                Assert.AreEqual(0, ToChange.Count);
                Assert.IsFalse(ToChange.Contains("1"));
            }
Exemplo n.º 2
0
            public void Should_Match_Insert()
            {
                ToChange.Add("1");
                ToMatch.Add(1);

                ToMatch.Insert(0, 2);

                Assert.AreEqual(1, ToChange.Count);
                Assert.IsFalse(ToChange.Contains("2"));

                ListUtils.MatchListChanges(ToChange, ToMatch, n => n.ToString(), s => Int32.Parse(s));

                Assert.AreEqual(2, ToChange.Count);
                Assert.IsTrue(ToChange.Contains("2"));
                Assert.AreEqual(0, ToChange.IndexOf("2"));
            }