示例#1
0
        public void OpenTest()
        {
            SwitchDemo target         = new SwitchDemo(); // TODO: 初始化为适当的值
            int        switchIndex    = 0;                // TODO: 初始化为适当的值
            string     errMsg         = string.Empty;     // TODO: 初始化为适当的值
            string     errMsgExpected = string.Empty;     // TODO: 初始化为适当的值
            bool       expected       = false;            // TODO: 初始化为适当的值
            bool       actual;

            actual = target.Open(switchIndex, ref errMsg);
            Assert.AreEqual(errMsgExpected, errMsg);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
示例#2
0
        public void SaveSnpTest()
        {
            ISwitch iSwitch      = new SwitchDemo();                      // TODO: 初始化为适当的值
            string  visaAddress  = "TCPIP0::172.20.30.133::inst0::INSTR"; // TODO: 初始化为适当的值
            bool    nextByTrace  = false;                                 // TODO: 初始化为适当的值
            bool    mutiChannel  = false;                                 // TODO: 初始化为适当的值
            N5224A  target       = new N5224A(iSwitch, visaAddress);      // TODO: 初始化为适当的值
            string  saveFilePath = "D:/11.s4p";                           // TODO: 初始化为适当的值
            int     switchIndex  = 0;                                     // TODO: 初始化为适当的值
            string  msg          = string.Empty;                          // TODO: 初始化为适当的值
            string  msgExpected  = string.Empty;                          // TODO: 初始化为适当的值
            bool    expected     = false;                                 // TODO: 初始化为适当的值
            bool    actual;

            actual = target.SaveSnp(saveFilePath, switchIndex, nextByTrace, mutiChannel, ref msg);
            Assert.AreEqual(msgExpected, msg);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
示例#3
0
文件: Util.cs 项目: xiexiaojun/HPMS
        public static bool SetHardware(Hardware hardware, ref ISwitch iswitch, ref VirtualVNA.NetworkAnalyzer.NetworkAnalyzer iNetworkAnalyzer, ref string msg, Func <DialogResult> blockedMsg)
        {
            try
            {
                switch (hardware.SwitchBox)
                {
                case SwitchBox.MCU:
                    iswitch = new SwitchMcu(hardware.VisaSwitchBox, hardware.SwitchResponseTime);
                    break;

                case SwitchBox.Demo:
                    iswitch = new SwitchDemo();
                    break;

                case SwitchBox.Manual:
                    iswitch = new SwitchManual(blockedMsg);
                    break;
                }


                switch (hardware.AnalyzerType)
                {
                case NetworkAnalyzerType.Demo:
                    iNetworkAnalyzer = new DemoAnalyzer(iswitch, hardware.VisaNetWorkAnalyzer, hardware.AnalyzerResponseTime);
                    break;

                case NetworkAnalyzerType.N5224A:
                    iNetworkAnalyzer = new N5224A(iswitch, hardware.VisaNetWorkAnalyzer, hardware.AnalyzerResponseTime);
                    break;
                }



                return(true);
            }
            catch (Exception e)
            {
                msg = e.Message;
                return(false);
            }
        }
示例#4
0
        public MainPage()
        {
            this.InitializeComponent();
//            ReadSwitch.Main1(null);
            SwitchDemo.Main1(null);
        }