public void Queue()
        {
            Queue <string> q = new Queue <string>();

            q.Enqueue("test1");
            q.Enqueue("test2");
            QueueClass a = new QueueClass()
            {
                Strings = q,
            };

            XmlDocument target = new XmlDocument();

            Serializer.Serialize((SystemXmlAdapter)target, a);

            Assert.AreEqual(1, target.DocumentElement.ChildNodes.Count);

            QueueClass b = Deserializer.Deserialize <QueueClass>((SystemXmlAdapter)target);

            while (true)
            {
                bool emptyA = a.Strings.Count == 0;
                bool emptyB = b.Strings.Count == 0;

                Assert.AreEqual(emptyA, emptyB);
                if (emptyA)
                {
                    break;
                }

                Assert.AreEqual(a.Strings.Dequeue(), b.Strings.Dequeue());
            }
        }
Exemplo n.º 2
0
        public App()
        {
            settings = new SettingsClass();
            settings.aFoldersPath = new ArrayList();
            settings.aFoldersSubfolders = new ArrayList();
            settings.aFoldersName = new ArrayList();
            settings.aFoldersXml = new ArrayList();
            settings.aFoldersFilter = new ArrayList();
            settings.aFoldersRequireXml = new ArrayList();
            settings.aFoldersRequireExt = new ArrayList();
            settings.aFoldersWaitTime = new ArrayList();
            settings.aFoldersIgnoreTime = new ArrayList();
            settings.aFoldersParameters = new ArrayList();
            settings.aFoldersParametersReplace = new ArrayList();
            settings.aFoldersParametersFlags = new ArrayList();

            queue = new QueueClass();
            queue.aQueueFileName = new ArrayList();
            queue.aQueueFilePath = new ArrayList();
            queue.aQueueTimeStamp = new ArrayList();
            queue.aQueueStatus = new ArrayList();
            queue.aQueueJobIdx = new ArrayList();
            queue.aQueueElapsed = new ArrayList();

            cApp = this;
        }
Exemplo n.º 3
0
        public void Queue()
        {
            Queue <string> q = new Queue <string>();

            q.Enqueue("test1");
            q.Enqueue("test2");
            QueueClass a = new QueueClass()
            {
                Strings = q,
            };

            JObject target = new JObject();

            Serializer.Serialize((NewtonsoftJsonAdapter)target, a);

            AssertChildren(3, target);

            QueueClass b = Deserializer.Deserialize <QueueClass>((NewtonsoftJsonAdapter)target);

            while (true)
            {
                bool emptyA = a.Strings.Count == 0;
                bool emptyB = b.Strings.Count == 0;

                Assert.AreEqual(emptyA, emptyB);
                if (emptyA)
                {
                    break;
                }

                Assert.AreEqual(a.Strings.Dequeue(), b.Strings.Dequeue());
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!  Here's a few Benjamins for to look the other way.");

            int[]      test0     = new int[] { 1, 2, 3, 4, 5, 6 };
            int[]      test1     = new int[] { 1, 2, 4, 3, 5, 6 };
            int[]      testChaos = new int[] { 1, 2, 6, 3, 4, 5 };
            int[]      test6     = new int[] { 2, 1, 5, 3, 4, 8, 6, 7, 10, 9 };
            QueueClass queueObj  = new QueueClass();

            queueObj.minimumBribes(test0);
            queueObj.minimumBribes(test1);
            queueObj.minimumBribes(testChaos);
            queueObj.minimumBribes(test6);
            Console.ReadLine();
        }
Exemplo n.º 5
0
 public void Initialize()
 {
     queue = new QueueClass<int>();
 }
Exemplo n.º 6
0
 public void Initialize()
 {
     queue = new QueueClass <int>();
 }