Example #1
0
 protected void NameSaveButton_Click(object sender, EventArgs e)
 {
     if (nameTextBox.Text != String.Empty && feeTextBox.Text != String.Empty)
     {
         try
         {
             var aTestNames = new TestNames
             {
                 TestName   = nameTextBox.Text,
                 Fee        = Convert.ToDouble(feeTextBox.Text),
                 TestTypeId = Convert.ToInt32(typeDropDownList.SelectedValue)
             };
             nameMessageLabel.Text = (Convert.ToDouble(feeTextBox.Text) > 0)
                 ? _aNameManager.SaveTestName(aTestNames)
                 : "Please insert amount greater than zero";
         }
         catch
         {
             nameMessageLabel.Text = "Please Insert information in the right format";
         }
     }
     else
     {
         nameMessageLabel.Text = "Please insert information properly";
     }
     Page_Load(sender, e);
 }
Example #2
0
 public void EnableTest(TestNames test)
 {
     testFunctions[(int)test].Enabled = true;
     if (test == TestNames.TestAmbientPressureSensor || test == TestNames.TestBoardTemp)
     {
         useSensor = true;
     }
 }
        public string SaveTestName(TestNames testNames)
        {
            if (!_aNameGateway.IsAlredyExist(testNames.TestName))
            {
                return(_aNameGateway.SaveTestName(testNames) ? "Saved Successfully" : "Save Failed");
            }

            return("Already Exist");
        }
Example #4
0
        public bool SaveTestName(TestNames testNames)
        {
            string query = "INSERT INTO TestNames Values('" + testNames.TestName + "','" + testNames.Fee + "','" + testNames.TestTypeId + "')";

            Command.CommandText = query;
            Connection.Open();
            var rowsAffected = Command.ExecuteNonQuery();

            Connection.Close();
            return(rowsAffected > 0);
        }
 //custom body
 //equals trait
 //hash code trait
 //pretty print
 public override void Print(PrettyPrinter printer)
 {
     printer.Println("UnitTestLaunch (");
     using (printer.IndentCookie()) {
         printer.Print("testNames = "); TestNames.PrintEx(printer); printer.Println();
         printer.Print("testGroups = "); TestGroups.PrintEx(printer); printer.Println();
         printer.Print("testCategories = "); TestCategories.PrintEx(printer); printer.Println();
         printer.Print("testResult = "); _TestResult.PrintEx(printer); printer.Println();
         printer.Print("runResult = "); _RunResult.PrintEx(printer); printer.Println();
     }
     printer.Print(")");
 }
Example #6
0
        protected override Task OnInitializedAsync()
        {
            TestNames.AddRange(_testCases.Keys);
            SelectedTest = TestNames.First();

            _interopTestInvoker = new InteropTestInvoker(new PageLoggerFactory(AddMessage), _testCases);

            var objRef = DotNetObjectReference.Create(_interopTestInvoker);

            _ = JSRuntime.InvokeAsync <string>("initialTestHelper", objRef);

            return(base.OnInitializedAsync());
        }
Example #7
0
        public void RunTest(int idx)
        {
            //Ensure test index is valid
            if (idx >= allTestCount)
            {
                return;
            }

            //Ensure test is enabled
            if (!testFunctions[idx].Enabled)
            {
                return;
            }

            //Ensure test can run on current treatment FW revision
            if (treatmentFwRev < testFunctions[idx].MinTreatmentFwRev)
            {
                return;
            }
            if (testFunctions[idx].MaxTreatmentFwRev != null)
            {
                if (treatmentFwRev > testFunctions[idx].MaxTreatmentFwRev)
                {
                    return;
                }
            }

            //Ensure test can run on current comm FW revision
            if (commFwRev < testFunctions[idx].MinCommFwRev)
            {
                return;
            }
            if (testFunctions[idx].MaxCommFwRev != null)
            {
                if (commFwRev > testFunctions[idx].MaxCommFwRev)
                {
                    return;
                }
            }

            //Ensure test can run on current HW revision
            if (hwRev < testFunctions[idx].MinHwRev)
            {
                return;
            }
            if (testFunctions[idx].MaxHwRev != null)
            {
                if (hwRev > testFunctions[idx].MaxHwRev)
                {
                    return;
                }
            }

            //Run test
            currentTest = (TestNames)idx;

            Thread.Sleep(100);  //TODO remove, this is for development purposes only
            resultList.Add(testFunctions[idx].RunTest());

            try
            {
                if (!fixture.device.IsVivo45Connected())
                {
                    //MessageBox.Show("Lost connection at test: " + currentTest.ToString());
                    return;
                }
                else
                {
                    //List<Vivo45Alarm> result = fixture.device.GetActiveAlarm(Breas.Device.Monitoring.Alarms.AlarmType.High);
                    //foreach (Vivo45Alarm a in result)
                    //{
                    //    if (a.Id == 40)
                    //    {
                    //        MessageBox.Show("Power fail happened at: " + currentTest.ToString());
                    //        return;
                    //    }
                    //}
                }
            }
            catch
            {
                return;
            }
        }
Example #8
0
        /// <summary>
        /// Returns the collection of argument strings defined by this instance.
        /// </summary>
        public IEnumerable <string> GetArguments()
        {
            foreach (var file in InputFiles ?? Enumerable.Empty <string>())
            {
                yield return($"\"{file}\"");
            }

            // TODO: @FILE

            if (TestNames?.Any() ?? false)
            {
                yield return($"--test=\"{string.Join(",", TestNames)}\"");
            }

            if (!string.IsNullOrEmpty(TestListFile))
            {
                yield return($"--testlist=\"{TestListFile}\"");
            }

            if (!string.IsNullOrEmpty(Where))
            {
                yield return($"--where=\"{Where}\"");
            }

            foreach (var key in Parameters?.Keys ?? Enumerable.Empty <string>())
            {
                yield return($"--p=\"{key}={Parameters?[key]}\"");
            }

            if (!string.IsNullOrEmpty(Configuration))
            {
                yield return($"--config=\"{Configuration}\"");
            }

            if (ProcessIsolation != NUnit3ProcessIsolation.Default)
            {
                yield return($"--process={GetProcessIsolationString()}");
            }

            if (InProcess)
            {
                yield return("--inprocess");
            }

            if (NumberOfAgents > 0)
            {
                yield return($"--agents={NumberOfAgents}");
            }

            if (DomainIsolation != NUnit3DomainIsolation.Default)
            {
                yield return($"--domain={GetDomainIsolationString()}");
            }

            if (!string.IsNullOrEmpty(Framework))
            {
                yield return($"--framework=\"{Framework}\"");
            }

            if (ForceX86)
            {
                yield return("--x86");
            }

            if (DisposeRunners)
            {
                yield return("--dispose-runners");
            }

            if (Timeout > 0)
            {
                yield return($"--timeout={Timeout}");
            }

            if (Seed > 0)
            {
                yield return($"--seed={Seed}");
            }

            if (Workers > 0)
            {
                yield return($"--workers={Workers}");
            }

            if (StopOnError)
            {
                yield return("--stoponerror");
            }

            if (SkipNonTestAssemblies)
            {
                yield return("--skipnontestassemblies");
            }

            if (Debug)
            {
                yield return("--debug");
            }

            if (!string.IsNullOrEmpty(WorkPath))
            {
                yield return($"--work=\"{WorkPath}\"");
            }

            if (!string.IsNullOrEmpty(OutputPath))
            {
                yield return($"--output=\"{OutputPath}\"");
            }

            foreach (var result in ResultSpecs ?? Enumerable.Empty <string>())
            {
                yield return($"--result=\"{result}\"");
            }

            if (Explore)
            {
                yield return("--explore");
            }

            foreach (var result in ExploreSpecs ?? Enumerable.Empty <string>())
            {
                yield return($"--explore=\"{result}\"");
            }

            if (NoResult)
            {
                yield return("--noresult");
            }

            if (TraceLevel != NUnit3TraceLevel.Default)
            {
                yield return($"--trace={GetTraceLevelString()}");
            }

            if (Labels != NUnit3Labels.Default)
            {
                yield return($"--labels={GetLabelsString()}");
            }

            if (!string.IsNullOrEmpty(TestNameFormat))
            {
                yield return($"--test-name-format=\"{TestNameFormat}\"");
            }

            if (!string.IsNullOrEmpty(Encoding))
            {
                yield return($"--encoding=\"{Encoding}\"");
            }

            if (ShadowCopy)
            {
                yield return("--shadowcopy");
            }

            if (TeamCity)
            {
                yield return("--teamcity");
            }

            if (LoadUserProfile)
            {
                yield return("--loaduserprofile");
            }

            if (ListExtensions)
            {
                yield return("--list-extensions");
            }

            if (PrincipalPolicy != NUnit3PrincipalPolicy.Default)
            {
                yield return($"--set-principal-policy={GetPrincipalPolicyString()}");
            }

            if (NoHeader)
            {
                yield return("--noheader");
            }

            if (NoColor)
            {
                yield return("--nocolor");
            }

            foreach (var arg in AdditionalArguments)
            {
                yield return(arg);
            }
        }