Esempio n. 1
0
        public void TestProcessorQueue()
        {
            // setup classes
            var processor    = new Processor();
            var birthMessage = getSampleBirthMessage();
            var childMessage = getSampleChildBirthMessage();
            var messageList  = getSampleMessageArray();

            // test empty queue
            Assert.AreEqual(0, processor.QueueLength);

            // add birth message
            processor.AddMessage(birthMessage);

            // test queue
            Assert.AreEqual(1, processor.QueueLength);

            // add child message
            processor.AddMessage(childMessage);

            // test queue
            Assert.AreEqual(2, processor.QueueLength);

            // add message list
            processor.AddMessages(messageList);

            // test queue
            Assert.AreEqual(4, processor.QueueLength);
        }
Esempio n. 2
0
        public void TestProcessorProceedQueueMethod()
        {
            // setup classes
            var processor   = new Processor();
            var messageList = getSampleMessageArray();
            var logPath     = ConfigurationManager.AppSettings["logFolder"];

            processor.AddMessages(messageList);

            // proceed
            processor.ProceedQueue();

            // test log
            Assert.AreEqual(true, File.Exists(Path.Combine(logPath, string.Format("{0}.log", DateTime.Today.ToString("yyyy-MM-dd")))));
        }