Пример #1
0
        private void SetRunnerToAvailable()
        {
            // Have to re-initilize. If it's been grabbed by several instances they'll all have a different count (Browser).
            TestDB = new TestDBContext();
            Runner = TestDB.Nodes.Find(Runner.ID);
            Test = TestDB.Tests.Find(Test.ID);
            Test.Status = null;

            switch (Test.Type)
            {
                case "iOS":
                    Runner.iOS = true;
                    break;
                case "Android":
                    Runner.Android = true;
                    break;
                case "Browser":
                    Runner.Browser++;
                    break;
                case "Desktop":
                    Runner.Desktop = true;
                    break;
            }
            TestDB.SaveChanges();
        }
Пример #2
0
 private bool RunnerFound()
 {
     Runner = GetAvailableNode();
     if (Runner == null)
     {
         TestDict[Test.Type].AddLast(Test.ID);
         return false;
     }
     else
     {
         Test.Status = TestRunner.Running;
         TestDB.SaveChanges();
         return true;
     }
 }