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

더 자세히 ...

Public 멤버 함수

void WriteWordsThenReadWords_ReturnsValuesFromRequestedOffset ()
void WriteBitsThenReadBits_ReturnsValuesFromRequestedOffset ()
void Clear_RemovesStoredBitAndWordValues ()
void ReadAndWrite_ReturnFailureForInvalidCounts ()

상세한 설명

In Memory Plc Memory Tests 기능과 관련 상태를 캡슐화합니다.

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

멤버 함수 문서화

◆ Clear_RemovesStoredBitAndWordValues()

void Dreamine.FullKit.Tests.PLC.InMemoryPlcMemoryTests.Clear_RemovesStoredBitAndWordValues ( )
inline

Clear Removes Stored Bit And Word Values 작업을 수행합니다.

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

70 {
71 var memory = new InMemoryPlcMemory();
72
73 memory.WriteWords(new PlcAddress(PlcDeviceType.D, 0), new short[] { 7 });
74 memory.WriteBits(new PlcAddress(PlcDeviceType.M, 0), new[] { true });
75
76 memory.Clear();
77
78 Assert.Equal(new short[] { 0 }, memory.ReadWords(new PlcAddress(PlcDeviceType.D, 0), 1).Value);
79 Assert.Equal(new[] { false }, memory.ReadBits(new PlcAddress(PlcDeviceType.M, 0), 1).Value);
80 }

◆ ReadAndWrite_ReturnFailureForInvalidCounts()

void Dreamine.FullKit.Tests.PLC.InMemoryPlcMemoryTests.ReadAndWrite_ReturnFailureForInvalidCounts ( )
inline

And Write Return Failure For Invalid Counts 데이터를 읽습니다.

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

92 {
93 var memory = new InMemoryPlcMemory();
94 var address = new PlcAddress(PlcDeviceType.D, 0);
95
96 Assert.False(memory.ReadWords(address, 0).IsSuccess);
97 Assert.False(memory.ReadBits(address, 0).IsSuccess);
98 Assert.False(memory.WriteWords(address, Array.Empty<short>()).IsSuccess);
99 Assert.False(memory.WriteBits(address, Array.Empty<bool>()).IsSuccess);
100 }

◆ WriteBitsThenReadBits_ReturnsValuesFromRequestedOffset()

void Dreamine.FullKit.Tests.PLC.InMemoryPlcMemoryTests.WriteBitsThenReadBits_ReturnsValuesFromRequestedOffset ( )
inline

Bits Then Read Bits Returns Values From Requested Offset 데이터를 씁니다.

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

48 {
49 var memory = new InMemoryPlcMemory();
50 var address = new PlcAddress(PlcDeviceType.M, 0);
51
52 var write = memory.WriteBits(address, new[] { true, false, true });
53 var read = memory.ReadBits(new PlcAddress(PlcDeviceType.M, 0), 4);
54
55 Assert.True(write.IsSuccess);
56 Assert.True(read.IsSuccess);
57 Assert.Equal(new[] { true, false, true, false }, read.Value);
58 }

◆ WriteWordsThenReadWords_ReturnsValuesFromRequestedOffset()

void Dreamine.FullKit.Tests.PLC.InMemoryPlcMemoryTests.WriteWordsThenReadWords_ReturnsValuesFromRequestedOffset ( )
inline

Words Then Read Words Returns Values From Requested Offset 데이터를 씁니다.

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

26 {
27 var memory = new InMemoryPlcMemory();
28 var address = new PlcAddress(PlcDeviceType.D, 100);
29
30 var write = memory.WriteWords(address, new short[] { 10, 20, 30 });
31 var read = memory.ReadWords(new PlcAddress(PlcDeviceType.D, 101), 2);
32
33 Assert.True(write.IsSuccess);
34 Assert.True(read.IsSuccess);
35 Assert.Equal(new short[] { 20, 30 }, read.Value);
36 }

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