示例#1
0
        public void NotifyItemAdded_ItemAdded_EntityFiresAggregateChangedEvent()
        {
            var collectionEntity = new EntityCollectionFixture();

            AggregateChangedEventArgs args = null;

            collectionEntity.AggregateChanged += (obj, eventArgs) => { args = eventArgs; };
            var item = collectionEntity.CreateCollectionItem(true);

            AssertItemAdded(args, item);
        }
示例#2
0
        public void SByteProperty_ChangingPropertyTwice_FiresOnAggregateChangedEventOneTimeOnly()
        {
            bool aggregateIsDirty = false;
            var  collectionEntity = new EntityCollectionFixture();
            var  item             = collectionEntity.CreateCollectionItem(true);

            collectionEntity.AggregateChanged += (obj, eventArgs) => { aggregateIsDirty = true; };

            aggregateIsDirty   = false;
            item.PropertyValue = false;

            Assert.IsTrue(aggregateIsDirty);
        }