Пример #1
0
        public void TestStreamStartStop()
        {
            using (var connection = new ISSConnection(Helper.GetDMCExeFile()))
            {
                var config        = Helper.GetIConfigurationRoot();
                var messageParser = new MessageParser(Helper.GetILogger <MessageParser>(), config);
                var adapter       = new ISSAdapter(config, messageParser, Helper.GetILogger <ISSAdapter>());

                adapter.Connect();

                var packets = 0;

                adapter.StartStreaming();
                Assert.IsTrue(adapter.IsStreaming());

                Thread.Sleep(1000);

                adapter.StopStreaming();
                Assert.IsFalse(adapter.IsStreaming());
                Assert.GreaterOrEqual(packets, 1);
                packets = 0;

                adapter.StartStreaming();
                Assert.IsTrue(adapter.IsStreaming());

                Thread.Sleep(1000);

                adapter.StopStreaming();
                Assert.IsFalse(adapter.IsStreaming());
                Assert.GreaterOrEqual(packets, 1);

                adapter.Disconnect();
                Assert.IsFalse(adapter.IsConnected());
            }
        }
Пример #2
0
        public void SetCycleNum()
        {
            using (var connection = new ISSConnection(Helper.GetDMCExeFile()))
            {
                var config        = Helper.GetIConfigurationRoot();
                var messageParser = new MessageParser(Helper.GetILogger <MessageParser>(), config);
                var adapter       = new ISSAdapter(config, messageParser, Helper.GetILogger <ISSAdapter>());

                adapter.Connect();

                var num = adapter.SetCycleNum(4);
                Assert.AreEqual(4, num);

                adapter.Disconnect();
            }
        }
Пример #3
0
        public void TestFrequencyGetSet()
        {
            using (var connection = new ISSConnection(Helper.GetDMCExeFile()))
            {
                var config        = Helper.GetIConfigurationRoot();
                var messageParser = new MessageParser(Helper.GetILogger <MessageParser>(), config);
                var adapter       = new ISSAdapter(config, messageParser, Helper.GetILogger <ISSAdapter>());

                adapter.Connect();
                var freq = adapter.GetFrequency();
                var list = adapter.GetFrequencies();

                Thread.Sleep(1000);
                adapter.Disconnect();
                Assert.IsFalse(adapter.IsConnected());
            }
        }