Esempio n. 1
0
        public void Task_Remove()
        {
            var task = new TestTask();

            TestTaskQueue.Enqueue(task);
            TestTaskQueue.Remove(task);
        }
Esempio n. 2
0
        public void Task_Peek()
        {
            var actual = TestTaskQueue.Enqueue("Test", "{}");

            Assert.NotNull(actual);
            Assert.True(actual.GetType() == typeof(TestTask));
        }
        private static void RefreshCodeTree(KodetreType kodetreType)
        {
            var t = new RefreshCodeTreeTask();

            t.KodetreType = kodetreType;

            TestTaskQueue.ProcessTask(t);
        }
Esempio n. 4
0
        private static void SendEmail(string recipient)
        {
            SendEmailTask t = new SendEmailTask
            {
                To      = recipient,
                Subject = "NiN SendEmailTaskTests",
                Body    = "Test PASS"
            };

            TestTaskQueue.ProcessTask(t);
        }
Esempio n. 5
0
        public void Task_Process_Invalid_Task()
        {
            var task = TestTaskQueue.Enqueue("invalid", "invalid");

            TestTaskQueue.ProcessTask(task);
        }
Esempio n. 6
0
 public void Task_Process()
 {
     TestTaskQueue.ProcessTask(new TestTask());
 }
Esempio n. 7
0
 public void Task_Remove_When_Empty()
 {
     Assert.Throws <Exception>(() => TestTaskQueue.Remove(new TestTask(-1)));
 }
Esempio n. 8
0
 public void Task_Enqueue()
 {
     TestTaskQueue.Enqueue(new TestTask());
 }
Esempio n. 9
0
 public void SqlCommandTask()
 {
     TestTaskQueue.ProcessTask(new SqlCommandTask("SELECT COUNT(*) FROM SysLog"));
 }
Esempio n. 10
0
 public void TileGridTask()
 {
     new DiskTileStore(Config.Settings.Map.Layers[0]).Wipe();
     TestTaskQueue.ProcessTask(new TileAreaTask(AreaType.Kommune, 0, "Nin"));
 }
Esempio n. 11
0
 static void Main(string[] args)
 {
     //Console.Title = "Test";
     //IntPtr intptr = FindWindow("ConsoleWindowClass", "Test");
     //if (intptr != IntPtr.Zero)
     //{
     //     ShowWindow(intptr, 0);
     //}
     //Console.WriteLine(new TestRun().re);
     if (args != null && args.Length != 0)
     {
         string arg1 = args[0].Trim().ToLower();
         if (arg1.Equals("console"))
         {
         }
         else if (arg1.Equals("winform"))
         {
             Application_Winform.EnableVisualStyles();
             Application_Winform.SetCompatibleTextRenderingDefault(false);
             Application_Winform.Run(new Form1());
         }
         else if (arg1.Equals("wpf"))
         {
             Application_WPF app = new Application_WPF();
             app.StartupUri = new Uri(@"C:\Users\Wang Dong\source\repos\nevermore\nevermore.wpf\MainWindow.xaml", UriKind.Absolute);
             //MainWindow win = new MainWindow();
             app.Run();
         }
     }
     else
     {
         //string[] paraArray = new string[]
         //{
         //    "ContainerPreNotification",
         //    "AllWithTarNbr",
         //    "0",
         //    "ContainerPreNotification$Id;ContainerPreNotification$Terminal;ContainerPreNotification$Status;ContainerPreNotification$OrderReference;ContainerPreNotification$ContainerId;ContainerPreNotification$LoadStatus;ContainerPreNotification$ISOCode;ContainerPreNotification$HandlingType;ContainerPreNotification$DriveThroughIndicator;ContainerPreNotification$TruckCallId;ContainerPreNotification$TruckingCompany;ContainerPreNotification$CreationDateTime;ContainerPreNotification$ChangeDateTime;ContainerPreNotification$PreGateCheckStatus;ContainerPreNotification$PreGateCheckDateTime;ContainerPreNotification$ExecutedByTruckCallId;ContainerPreNotification$ExecutedFromTruckAppointmentId;TruckCall$TAR;TruckCall$CallCardNumber;ContainerPreNotification$GateZone",
         //    "<Filter version=\"2.0\">\r\n  <CompoundFilter Type=\"And\">\r\n    <FilterLeaf Entity=\"ContainerPreNotification\" Property=\"Terminal\" Condition=\"=\" ContextType=\"string\" Context=\"K1742\" />\r\n    <CompoundFilter Type=\"Or\">\r\n      <FilterLeaf Entity=\"ContainerPreNotification\" Property=\"Status\" Condition=\"=\" ContextType=\"string\" Context=\"PRV\" />\r\n      <FilterLeaf Entity=\"ContainerPreNotification\" Property=\"Status\" Condition=\"=\" ContextType=\"string\" Context=\"ANC\" />\r\n    </CompoundFilter>\r\n  </CompoundFilter>\r\n</Filter>",
         //    "ContainerPreNotification$CreationDateTime$DESCENDING;ContainerPreNotification$CreationDateTime$DESCENDING"
         // };
         //while (!Console.ReadLine().Equals("q"))
         //{
         //    string res = DBHelper.GetDataSetUsingPagedStoredProcedure("ctcs_v53030x_csp_getEntityList", paraArray, 0, 12);
         //    Console.WriteLine(res);
         //}
         //WordReplaceTagWord.Replace(@"E:\project\TestFiles\ReplaceTags.docx");
         //new ReplaceTagWithoutWord();
         //new insertPicToDoc().insert(@"C:\Users\Administrator\Desktop\mdbak.doc", @"C:\Users\Administrator\Desktop\158112890332.png", "SIGNT");
         //Console.WriteLine("Enter 'q' to exit!");
         //while (true)
         //{
         //    string path = Console.ReadLine();
         //    if (path.Equals("q"))
         //    {
         //        break;
         //    }
         //    if (Directory.Exists(path))
         //    {
         //        Console.WriteLine("ok");
         //    }
         //    else
         //    {
         //        Console.WriteLine("Nok");
         //    }
         //}
         TestTaskQueue.Run();
     }
     Console.ReadLine();
 }