public void InitializeTriggerManagerTwoTimesWithTwoTypes() { TriggerManager.Instance.Initialize <DBTrigger>(TriggerReader.ReadTriggerList()); TriggerManager.Instance.Initialize <WindowsServiceTrigger>(TriggerReader.ReadTriggerList()); Type type = typeof(DBTrigger); var dbTriggers = TriggerManager.Instance.GetTriggers <DBTrigger>(); Assert.AreEqual(dbTriggers.Count, TriggerReader.DBTriggerCount); var wsTriggers = TriggerManager.Instance.GetTriggers <WindowsServiceTrigger>(); Assert.AreEqual(wsTriggers.Count, TriggerReader.WSTriggerCount); //All triggers var allTriggers = TriggerManager.Instance.GetTriggers(); Assert.AreEqual( allTriggers.Values.Sum(list => list.Count), TriggerReader.TriggerCount); //Trigger Types var triggerTypeCount = TriggerManager.Instance.GetTriggers().Count(); Assert.AreEqual(triggerTypeCount, TriggerReader.TriggerTypesCount); }
public void InitializeTriggerManagerTwoTimes() { TriggerManager.Instance.Initialize(TriggerReader.ReadTriggerList()); var first = TriggerManager.Instance.GetTriggers().Count(); TriggerManager.Instance.Initialize(TriggerReader.ReadTriggerList()); var second = TriggerManager.Instance.GetTriggers().Count(); Assert.AreEqual(first, second, TriggerReader.TriggerCount); }
public void GetAllTriggers() { TriggerManager.Instance.Initialize(TriggerReader.ReadTriggerList()); var triggers = TriggerManager.Instance.GetTriggers(); Assert.AreEqual( triggers.Values.Sum(list => list.Count), TriggerReader.TriggerCount); Assert.AreEqual( triggers.Count(), TriggerReader.TriggerTypesCount); }
public void GetAllTriggersByType() { TriggerManager.Instance.Initialize(TriggerReader.ReadTriggerList()); var dbTriggers = TriggerManager.Instance.GetTriggers <DBTrigger>(); Assert.AreEqual(dbTriggers.Count, TriggerReader.DBTriggerCount); var wsTriggers = TriggerManager.Instance.GetTriggers <WindowsServiceTrigger>(); Assert.AreEqual(wsTriggers.Count, TriggerReader.WSTriggerCount); var allTriggers = TriggerManager.Instance.GetTriggers(); Assert.AreEqual( allTriggers.Values.Sum(list => list.Count), TriggerReader.TriggerCount); }
public void InitializeTriggerManagerWithOneType() { TriggerManager.Instance.Initialize <DBTrigger>(TriggerReader.ReadTriggerList()); Assert.IsTrue(true); }
public void InitializeTriggerManager() { TriggerManager.Instance.Initialize(TriggerReader.ReadTriggerList()); Assert.IsTrue(true); }