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()); } }
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(); } }
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()); } }