Example #1
0
 public void Add(object key, DataModelChangeType changeType, IList <string> changes)
 {
     foreach (string change in changes)
     {
         Add(key, changeType, change);
     }
 }
        private DetectedChange GetDetectedChangeByType(DataModelChangeType type)
        {
            DetectedChange detectedChangeToReturn = null;

            if (ListedDetectedChanges == null)
            {
                ListedDetectedChanges  = new List <DetectedChange>();
                detectedChangeToReturn = new DetectedChange(type);
                ListedDetectedChanges.Add(detectedChangeToReturn);
            }
            else
            {
                foreach (DetectedChange dc in ListedDetectedChanges)
                {
                    if (dc.ChangeType == type)
                    {
                        detectedChangeToReturn = dc;
                    }
                }
                if (detectedChangeToReturn == null)
                {
                    detectedChangeToReturn = new DetectedChange(type);
                    ListedDetectedChanges.Add(detectedChangeToReturn);
                }
            }

            return(detectedChangeToReturn);
        }
Example #3
0
 public DetectedChange(DataModelChangeType type, string txt)
 {
     ChangeType = type;
     if (txt != string.Empty)
     {
         Changes.Add(txt);
     }
 }
Example #4
0
        public void Vanilla()
        {
            /* setup */
            DetectedChange dc = Factory.getVanillaTestObject();

            /* method to test*/
            DataModelChangeType dmct = dc.ChangeType;
            List <string>       list = dc.Changes;

            /* evaluation */
            Assert.IsTrue(dmct.Equals(DataModelChangeType.New));
            Assert.IsNull(list);
        }
Example #5
0
 public void Add(object key, DataModelChangeType changeType, string change)
 {
     if (ContainsKey(key))
     {
         if (!string.IsNullOrEmpty(change))
         {
             this[key].AddChange(changeType, change);
         }
     }
     else
     {
         this[key] = new DataModelChange(changeType, change);
     }
 }
Example #6
0
        public void ChangeChangeType()
        {
            /* setup */
            DetectedChange      dc     = Factory.getVanillaTestObject();
            DataModelChangeType dmctIn = DataModelChangeType.ModifiedHint;

            /* method to test*/
            dc.ChangeType = dmctIn;

            DataModelChangeType dmctOut = dc.ChangeType;

            /* evaluation */
            Assert.IsFalse(dmctOut == DataModelChangeType.New);
            Assert.IsTrue(dmctOut == dmctIn);
        }
        public bool ContainDataModelChangeType(DataModelChangeType type)
        {
            bool toReturn = false;

            if (ListedDetectedChanges != null)
            {
                foreach (DetectedChange dc in ListedDetectedChanges)
                {
                    if (dc.ChangeType == type)
                    {
                        toReturn = true;
                    }
                }
            }
            return(toReturn);
        }
 public void AddChange(DataModelChangeType type, string change)
 {
     GetDetectedChangeByType(type).AddText(change);
 }
 public DataModelChange(DataModelChangeType type, string change)
 {
     AddChange(type, change);
     Apply = true;
 }
 public DataModelChange(DataModelChangeType type) : this(type, string.Empty)
 {
 }
Example #11
0
 public void Add(object key, DataModelChangeType changeType)
 {
     Add(key, changeType, string.Empty);
 }