Esempio n. 1
0
        public void AddAndRemove_ItemToEmptyDictionary_AddsOneProperly()
        {
            SimplifiedKeyIdentifiableMother.Implementation item =
                SimplifiedKeyIdentifiableMother.Implementation.CreateListOfOne()[0];

            this.model.Add(item);
            Assert.AreEqual(1, this.model.Count);
            AssertEnumerator(this.model);
            Assert.IsTrue(this.model.ContainsKey(item.Key));
            Assert.AreEqual(item, this.model[item.Key]);

            Assert.IsTrue(this.model.Remove(item));
            Assert.AreEqual(0, this.model.Count);
            AssertEnumerator(this.model);
            Assert.IsFalse(this.model.ContainsKey(item.Key));

            this.model.Add(item);
            Assert.AreEqual(1, this.model.Count);
            AssertEnumerator(this.model);
            Assert.IsTrue(this.model.ContainsKey(item.Key));
            Assert.AreEqual(item, this.model[item.Key]);

            Assert.IsTrue(this.model.Remove(item.Key));
            Assert.AreEqual(0, this.model.Count);
            AssertEnumerator(this.model);
            Assert.IsFalse(this.model.ContainsKey(item.Key));
        }
Esempio n. 2
0
        public void BusinessEquals_ToInstancesWithTheSameSimplifiedKeyValueButDifferentBussinesKeyValue_ReturnsFalse()
        {
            var itemOne = new SimplifiedKeyIdentifiableMother.Implementation("Daniel", "Dabrowski", new DateTime(1922, 02, 17));
            var itemTwo = new SimplifiedKeyIdentifiableMother.Implementation("John", "Doe", new DateTime(1978, 02, 10));

            Assert.IsTrue(itemOne.Key.Equals(itemTwo.Key));
            Assert.IsFalse(itemOne.Key.BusinessEquals(itemTwo.Key));
        }
Esempio n. 3
0
 public Implementation(SimplifiedKeyIdentifiableMother.Implementation parent)
 {
     this.parent = parent;
 }