Ejemplo n.º 1
0
        public void ObjectResultTest()
        {
            TempResultListener rl = new TempResultListener();

            ResultSettings.Current.Add(rl);

            TestPlan         plan = new TestPlan();
            DelegateTestStep step = new DelegateTestStep();

            step.RunAction = (Results) =>
            {
                Results.Publish(new MyResult {
                    A = 123, b = -123e-1
                });
            };
            plan.ChildTestSteps.Add(step);
            TestPlanRunner.RunTestPlan(plan);

            Assert.IsNotNull(rl.LastResult);
            Assert.AreEqual("My object result", rl.LastResult.Name);
            Assert.AreEqual(2, rl.LastResult.Columns.Length);
            Assert.AreEqual(1, rl.LastResult.Rows);
            Assert.AreEqual("Testing", rl.LastResult.Columns[0].Name);
            Assert.AreEqual("Value [dBm]", rl.LastResult.Columns[1].Name);

            Assert.AreEqual(TypeCode.Int32, rl.LastResult.Columns[0].TypeCode);
            Assert.AreEqual(TypeCode.Double, rl.LastResult.Columns[1].TypeCode);

            Assert.AreEqual(123, rl.LastResult.Columns[0].GetValue <Int32>(0));
            Assert.AreEqual(-123e-1, rl.LastResult.Columns[1].GetValue <double>(0));

            ResultSettings.Current.Remove(rl);
        }
Ejemplo n.º 2
0
        public void DerivedObjectResultTest()
        {
            TempResultListener rl = new TempResultListener();

            ResultSettings.Current.Add(rl);

            TestPlan         plan   = new TestPlan();
            DelegateTestStep step   = new DelegateTestStep();
            ResultObjectBase result = new EvmResultObject()
            {
                Freq = 1, Power = 2, Evm = 3
            };

            step.RunAction = (Results) =>
            {
                Results.Publish(result);
            };
            plan.ChildTestSteps.Add(step);
            TestPlanRunner.RunTestPlan(plan);

            Assert.IsNotNull(rl.LastResult);
            Assert.AreEqual("EvmResultObject", rl.LastResult.Name);
            Assert.AreEqual(3, rl.LastResult.Columns.Length);
            Assert.AreEqual(1, rl.LastResult.Rows);
            Assert.AreEqual("Evm", rl.LastResult.Columns[0].Name);

            ResultSettings.Current.Remove(rl);
        }
Ejemplo n.º 3
0
        public void NaNValueTest()
        {
            TestPlan         plan = new TestPlan();
            DelegateTestStep step = new DelegateTestStep();

            step.RunAction = (Results) =>
            {
                Results.Publish("NaNValueType", new List <string> {
                    "a", "b", "c", "d"
                }, 0, double.NaN, 10, 0);
            };
            plan.ChildTestSteps.Add(step);
            TestPlanRunner.RunTestPlan(plan);
        }
Ejemplo n.º 4
0
        public void LargeValueTest()
        {
            TestPlan         plan = new TestPlan();
            DelegateTestStep step = new DelegateTestStep();

            step.RunAction = (Results) =>
            {
                Results.Publish("LargeValueType", new List <string> {
                    "a", "b", "c", "d"
                }, 0, 9.91e37, 10, 0);                                                                         // This is the large  value that X-Apps returns when there was no measurement.
            };
            plan.ChildTestSteps.Add(step);
            TestPlanRunner.RunTestPlan(plan);
        }