public void Constructor_RemovedItemIsNull_ThrowsArgumentNullException()
 {
     var entity = new AllPrimitiveTypes();
     new AggregateChangedEventArgs(
         entity,
         entity,
         "SomeProperty",
         AggregateChangedType.CollectionItemRemoved,
         null);
 }
        public void DoubleProperty_ChangingPropertyTwice_FiresOnAggregateChangedEventOneTimeOnly()
        {
            bool aggregateIsDirty = false;
            var allPrimitiveTypes = new AllPrimitiveTypes();
            allPrimitiveTypes.AggregateChanged += (obj, eventArgs) => { aggregateIsDirty = true; };

            allPrimitiveTypes.DoubleProperty = 100;
            aggregateIsDirty = false;
            allPrimitiveTypes.DoubleProperty = 100;

            Assert.IsFalse(aggregateIsDirty);
        }
        public void StringProperty_ChangingPropertyToNullWhenItIsAlreadyNull_DoesNotFireAggregateChanged()
        {
            bool aggregateIsDirty = false;
            var allPrimitiveTypes = new AllPrimitiveTypes();
            allPrimitiveTypes.AggregateChanged += (obj, eventArgs) => { aggregateIsDirty = true; };

            allPrimitiveTypes.StringProperty = null;

            Assert.IsFalse(aggregateIsDirty);
        }
 public void Constructor_PropertyNameIsNull_ThrowsArgumentNullException()
 {
     var entity = new AllPrimitiveTypes();
     new AggregateChangedEventArgs(entity, entity, null, 1, 0);
 }
 public void Constructor_AllParametersProvided_Succeeds()
 {
     var entity = new AllPrimitiveTypes();
     new AggregateChangedEventArgs(entity, entity, "SomeProp", 1, 0);
 }