/// <summary>
 /// Initializes a new instance of PSAlertModification
 /// </summary>
 /// <param name="history">history of alerts</param>
 public PSSmartGroupModification(SmartGroupModification history)
 {
     Items = new List <PSSmartGroupModificationItem>();
     foreach (var item in history.Properties.Modifications)
     {
         Items.Add(new PSSmartGroupModificationItem(item));
     }
 }
Exemplo n.º 2
0
        private void CheckHistoryContainsStateChangeEvent(SmartGroupModification smartGroupHistory)
        {
            bool eventFound = false;

            IList <SmartGroupModificationItem> modifications = smartGroupHistory.Properties.Modifications;

            foreach (var item in modifications)
            {
                if (item.ModificationEvent == SmartGroupModificationEvent.StateChange)
                {
                    Assert.Equal(AlertState.New, item.OldValue);
                    Assert.Equal(AlertState.Closed, item.NewValue);
                    eventFound = true;
                    break;
                }
            }

            if (!eventFound)
            {
                throw new Exception("Test Failed : State update event not found in alert history.");
            }
        }