Dreamine.FullKit.Tests 1.0.0.0
Dreamine.FullKit.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.FullKit.Tests.PLC.MitsubishiMcProtocolTests 클래스 참조sealed

더 자세히 ...

Public 멤버 함수

void DeviceCodeMapper_MapsSupportedDeviceTypes ()
void FrameBuilder_BuildsBinary3EReadFrame ()
void ResponseParser_ParsesWordAndBitResponses ()
void EndianHelpers_RejectOutOfRangeUInt24 ()

정적 Private 멤버 함수

static byte[] BuildResponse (params byte[] data)

상세한 설명

Mitsubishi Mc Protocol Tests 기능과 관련 상태를 캡슐화합니다.

MitsubishiMcProtocolTests.cs 파일의 16 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ BuildResponse()

byte[] Dreamine.FullKit.Tests.PLC.MitsubishiMcProtocolTests.BuildResponse ( params byte[] data)
inlinestaticprivate

Response 값을 구성합니다.

매개변수
datadata에 사용할 byte[] 값입니다.
반환값
Build Response 작업에서 생성한 byte[] 결과입니다.

MitsubishiMcProtocolTests.cs 파일의 119 번째 라인에서 정의되었습니다.

120 {
121 var length = data.Length;
122 return new byte[]
123 {
124 0x00, 0xD0, 0, 0, 0, 0, 0,
125 (byte)length, (byte)(length >> 8)
126 }.Concat(data).ToArray();
127 }

다음에 의해서 참조됨 : ResponseParser_ParsesWordAndBitResponses().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ DeviceCodeMapper_MapsSupportedDeviceTypes()

void Dreamine.FullKit.Tests.PLC.MitsubishiMcProtocolTests.DeviceCodeMapper_MapsSupportedDeviceTypes ( )
inline

Device Code Mapper Maps Supported Device Types 작업을 수행합니다.

MitsubishiMcProtocolTests.cs 파일의 27 번째 라인에서 정의되었습니다.

28 {
29 var mapper = new MitsubishiMcDeviceCodeMapper();
30
31 Assert.Equal(MitsubishiMcDeviceCode.D, mapper.Map(PlcDeviceType.D).Value);
32 Assert.Equal(MitsubishiMcDeviceCode.M, mapper.Map(PlcDeviceType.M).Value);
33 Assert.False(mapper.Map(PlcDeviceType.Unknown).IsSuccess);
34 }

◆ EndianHelpers_RejectOutOfRangeUInt24()

void Dreamine.FullKit.Tests.PLC.MitsubishiMcProtocolTests.EndianHelpers_RejectOutOfRangeUInt24 ( )
inline

Endian Helpers Reject Out Of Range U Int24 작업을 수행합니다.

MitsubishiMcProtocolTests.cs 파일의 85 번째 라인에서 정의되었습니다.

86 {
87 var bytes = new List<byte>();
88
89 MitsubishiMcEndian.WriteUInt16LittleEndian(bytes, 0x1234);
90
91 Assert.Equal(new byte[] { 0x34, 0x12 }, bytes);
92 Assert.Throws<ArgumentOutOfRangeException>(() => MitsubishiMcEndian.WriteUInt24LittleEndian(bytes, -1));
93 }

◆ FrameBuilder_BuildsBinary3EReadFrame()

void Dreamine.FullKit.Tests.PLC.MitsubishiMcProtocolTests.FrameBuilder_BuildsBinary3EReadFrame ( )
inline

Frame Builder Builds Binary3 E Read Frame 작업을 수행합니다.

MitsubishiMcProtocolTests.cs 파일의 45 번째 라인에서 정의되었습니다.

46 {
47 var options = new MitsubishiMcConnectionOptions();
48 var result = new MitsubishiMcBinary3EFrameBuilder()
49 .BuildBatchReadFrame(options, new PlcAddress(PlcDeviceType.D, 100), 2, isBitAccess: false);
50
51 Assert.True(result.IsSuccess);
52 Assert.Equal(0x00, result.Value![0]);
53 Assert.Equal(0x50, result.Value[1]);
54 Assert.Contains((byte)MitsubishiMcDeviceCode.D, result.Value);
55 }

◆ ResponseParser_ParsesWordAndBitResponses()

void Dreamine.FullKit.Tests.PLC.MitsubishiMcProtocolTests.ResponseParser_ParsesWordAndBitResponses ( )
inline

Response Parser Parses Word And Bit Responses 작업을 수행합니다.

MitsubishiMcProtocolTests.cs 파일의 66 번째 라인에서 정의되었습니다.

67 {
68 var parser = new MitsubishiMcBinary3EResponseParser();
69 var wordFrame = BuildResponse(0x00, 0x00, 0x34, 0x12, 0xFE, 0xFF);
70 var bitFrame = BuildResponse(0x00, 0x00, 0x11);
71
72 Assert.Equal(new short[] { 0x1234, -2 }, parser.ParseReadWords(wordFrame, 2).Value);
73 Assert.Equal(new[] { true, true }, parser.ParseReadBits(bitFrame, 2).Value);
74 }

다음을 참조함 : BuildResponse().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: