- Deleted `CalibrationStruct`, `ConfigStruct`, `Enums`, `Factory`, `GenesisHead`, and related files.
48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using System.IO.Ports;
|
|
using JetBrains.Annotations;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace TBFTests.Rig.TestMethods.GenesisCommunication.GenesisHead
|
|
{
|
|
[TestClass]
|
|
//[TestSubject(typeof(GenesisHeadBatchIntegration))]
|
|
public class GenesisHeadBatchIntegrationTest
|
|
{
|
|
string ComPort = "COM3";
|
|
int BaudRate = 112500;
|
|
|
|
|
|
|
|
[TestMethod]
|
|
[TestCategory("Hardware")]
|
|
[TestCategory("Serial")]
|
|
public void SerialPortConnection_IntegrationTest()
|
|
{
|
|
using (var port = new SerialPort(ComPort, BaudRate, Parity.None, 8, StopBits.One))
|
|
{
|
|
//port.Handshake = Handshake.None;
|
|
//port.ReadTimeout = 5000;
|
|
port.Open();
|
|
|
|
|
|
// var bufferSize = this.serialPort.ReadBufferSize;
|
|
// var buffer = new byte[bufferSize];
|
|
// var length = default(int);
|
|
//
|
|
// while (this.serialPort.IsOpen)
|
|
// {
|
|
// buffer = new byte[bufferSize];
|
|
// length = this.serialPort.Read(buffer, 0, bufferSize);
|
|
//
|
|
// Array.Resize(ref buffer, length);
|
|
//
|
|
// yield return buffer;
|
|
//
|
|
// manualResetEventSlim.Reset();
|
|
// manualResetEventSlim.Wait();
|
|
// }
|
|
|
|
}
|
|
}
|
|
}
|
|
} |