public void LogicEqualityComparerLinqExcept()
 {
     var people = new List<Person>() { _abe, _joe1, _sue, _joe2 };
     var peopleWhoAreJoe = new List<Person>() { _joe1 };
     var comparer = new LogicEqualityComparer<Person>();
     var peopleWhoAreNotJoe = people.Except(peopleWhoAreJoe, comparer);
     Assert.IsTrue(peopleWhoAreNotJoe.Count() == 2);
     Assert.IsFalse(peopleWhoAreNotJoe.Where(p => p.Name == "Joe").Any());
 }
 public void Initialize()
 {
     _objectComparer = new LogicEqualityComparer();
     _typedComparer = new LogicEqualityComparer<KeyValuePair<string, List<Person>>>();
     _abe = new Person() { Name = "Abe" };
     _joe1 = new Person() { Name = "Joe" };
     _joe2 = new Person() { Name = "Joe" };
     _sue = new Person() { Name = "Sue" };
 }
        public void LogicEqualityComparerLinqExcept()
        {
            var people = new List <Person>()
            {
                _abe, _joe1, _sue, _joe2
            };
            var peopleWhoAreJoe = new List <Person>()
            {
                _joe1
            };
            var comparer           = new LogicEqualityComparer <Person>();
            var peopleWhoAreNotJoe = people.Except(peopleWhoAreJoe, comparer);

            Assert.IsTrue(peopleWhoAreNotJoe.Count() == 2);
            Assert.IsFalse(peopleWhoAreNotJoe.Where(p => p.Name == "Joe").Any());
        }
 public void Initialize()
 {
     _objectComparer = new LogicEqualityComparer();
     _typedComparer  = new LogicEqualityComparer <KeyValuePair <string, List <Person> > >();
     _abe            = new Person()
     {
         Name = "Abe"
     };
     _joe1 = new Person()
     {
         Name = "Joe"
     };
     _joe2 = new Person()
     {
         Name = "Joe"
     };
     _sue = new Person()
     {
         Name = "Sue"
     };
 }