예제 #1
0
        public void Add()
        {
            var person = new Person("Adult1", 50);

            _updater.AddOrUpdate(person, "Adult1");
            IChangeSet <Person, string> updates = _updater.AsChangeSet();

            _cache.Lookup("Adult1").Value.Should().Be(person);
            _cache.Count.Should().Be(1);
            1.Should().Be(updates.Count, "Should be 1 updates");
            updates.First().Should().Be(new Change <Person, string>(ChangeReason.Add, person.Name, person), "Should be 1 updates");
        }
예제 #2
0
        public void Add()
        {
            var person = new Person("Adult1", 50);

            _updater.AddOrUpdate(person, "Adult1");
            IChangeSet <Person, string> updates = _updater.AsChangeSet();

            Assert.AreEqual(person, _cache.Lookup("Adult1").Value);
            Assert.AreEqual(1, _cache.Count);
            Assert.AreEqual(updates.Count, 1, "Should be 1 updates");
            Assert.AreEqual(new Change <Person, string>(ChangeReason.Add, person.Name, person), updates.First(),
                            "Should be 1 updates");
        }