Exemple #1
0
        public void Add_Two_Event_Dequeue_One_Event_Assert_Equal_Event()
        {
            // 1) arrange
            AEvent secondEvent = new AddedNewIvrEvent();

            // 2) act
            AEvent actual = queue.Dequeue(pluginName);
            AEvent expect = e;

            // 3) assert
            Assert.Equal(expect, actual);
        }
Exemple #2
0
        public void Add_Two_Event_Dequeue_Event_Assert_Not_Equal_Event()
        {
            // 1) arrange
            AEvent secondEvent = new AddedNewIvrEvent();

            // 2) act
            AEvent temp   = queue.Dequeue(pluginName);
            bool   actual = temp.Equals(secondEvent);
            bool   expect = false;

            // 3) assert
            Assert.Equal(expect, actual);
        }
Exemple #3
0
        public void Add_Two_Event_Dequeue_One_Assert_Count()
        {
            // 1) arrange
            AEvent secondEvent = new AddedNewIvrEvent();

            // 2) act
            queue.Enqueue(pluginName, secondEvent);
            AEvent temp   = queue.Dequeue(pluginName);
            int    actual = queue.GetCount(pluginName);
            int    expect = 1;

            // 3) assert
            Assert.Equal(expect, actual);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("FirstExampleApp starting ...");

            EventAggregator aggregator = new EventAggregator();

            aggregator.SubscribePlugin("FirstExampleApp");
            var v = new MyAnotherExampleEventListener();

            aggregator.Subscribe(v);
            aggregator.Subscribe(new MyExampleEventListener());
            aggregator.Subscribe(new AllExampleEventListener());

            while (true)
            {
                Console.WriteLine("Press 'i' to send new IVR tree or press 'w' to generate new wave...\n");
                ConsoleKeyInfo key = Console.ReadKey();
                if (key.KeyChar.Equals('i'))
                {
                    var e = new AddedNewIvrEvent {
                        Identificator = "Some unique ID for example."
                    };
                    aggregator.GlobalPublish(e);
                }
                else if (key.KeyChar.Equals('w'))
                {
                    var e = new DesiredWavesEvent();
                    e.Content.Add("Some text for convert to wave.");
                    e.Content.Add("Some today information.");
                    e.Content.Add("Another sentence.");
                    aggregator.GlobalPublish(e);
                }
                else
                {
                    break;
                }
            }

            Console.WriteLine("... FirstExampleApp started.");
            Console.ReadKey();
        }