/// <summary> /// Initializes a new instance of PSAlertModification /// </summary> /// <param name="history">history of alerts</param> public PSAlertModification(AlertModification history) { Items = new List <PSAlertModificationItem>(); foreach (var item in history.Properties.Modifications) { Items.Add(new PSAlertModificationItem(item)); } }
private void CheckHistoryContainsStateChangeEvent(AlertModification alertHistory) { bool eventFound = false; IList <AlertModificationItem> modifications = alertHistory.Properties.Modifications; foreach (var item in modifications) { if (item.ModificationEvent == AlertModificationEvent.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."); } }