Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public void InitializeTriggerManagerWithOneType()
        {
            TriggerManager.Instance.Initialize <DBTrigger>(TriggerReader.ReadTriggerList());

            Assert.IsTrue(true);
        }
Beispiel #6
0
        public void InitializeTriggerManager()
        {
            TriggerManager.Instance.Initialize(TriggerReader.ReadTriggerList());

            Assert.IsTrue(true);
        }