Exemplo n.º 1
0
        public void BusinessEquals_ToInstancesWithTheSameSimplifiedKeyValueAndTheSameBussinesKeyValue_ReturnsFalse()
        {
            var itemOne = new SimplifiedKeyIdentifiableMother.Implementation("Daniel", "Dabrowski", new DateTime(1922, 02, 17));
            var itemTwo = new SimplifiedKeyIdentifiableMother.Implementation("Daniel", "Dabrowski", new DateTime(1922, 02, 17));

            Assert.IsTrue(itemOne.Key.Equals(itemTwo.Key));
            Assert.IsTrue(itemOne.Key.BusinessEquals(itemTwo.Key));
        }
Exemplo n.º 2
0
        public void BusinessEquals_ToInstancesWithTheSameSimplifiedKeyValueButDifferentBussinesKeyValue_ReturnsFalse()
        {
            var itemOne = new SimplifiedKeyIdentifiableMother.Implementation("Daniel", "Dabrowski", new DateTime(1922, 02, 17));
            var itemTwo = Runtime.Isx64()
                              ? new SimplifiedKeyIdentifiableMother.Implementation("John", "Doe", new DateTime(1971, 02, 10))
                              : new SimplifiedKeyIdentifiableMother.Implementation("John", "Doe", new DateTime(1978, 02, 10));

            Assert.IsTrue(itemOne.Key.Equals(itemTwo.Key));
            Assert.IsFalse(itemOne.Key.BusinessEquals(itemTwo.Key));
        }
Exemplo n.º 3
0
        public void FindNonUniqueValues()
        {
            var one = new SimplifiedKeyIdentifiableMother.Implementation("Daniel", "Dabrowski", new DateTime(1922, 02, 17));

            SimplifiedKeyIdentifiableMother.Implementation two   = null;
            SimplifiedKeyIdentifiableMother.Implementation three = null;
            for (int i = 1900; i < 2000; i++)
            {
                two   = new SimplifiedKeyIdentifiableMother.Implementation("John", "Doe", new DateTime(i, 02, 10));
                three = new SimplifiedKeyIdentifiableMother.Implementation("Jeremy", "Brown", new DateTime(i, 10, 02));
                if (one.Key.Equals(two.Key))
                {
                    Console.Out.WriteLine("TWO " + i);
                }

                if (one.Key.Equals(three.Key))
                {
                    Console.Out.WriteLine("THREE " + i);
                }
            }
        }
Exemplo n.º 4
0
 public Implementation(SimplifiedKeyIdentifiableMother.Implementation parent)
 {
     this.parent = parent;
 }