Dreamine.FullKit.Tests
1.0.0.0
Dreamine.FullKit.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
ComponentFormatterTests.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.PLC.Abstractions.Devices;
2
using
Dreamine.PLC.Mitsubishi.MxComponent.Devices;
3
using
Dreamine.PLC.Mitsubishi.MxComponent.Options;
4
using
Dreamine.PLC.Omron.CxComponent.Devices;
5
using
Dreamine.PLC.Omron.CxComponent.Options;
6
7
namespace
Dreamine.FullKit.Tests.PLC
;
8
17
public
sealed
class
ComponentFormatterTests
18
{
27
[Fact]
28
public
void
MitsubishiMxFormatter_FormatsDecimalAndHexDevices
()
29
{
30
Assert.Equal(
"D100"
, MitsubishiMxDeviceNameFormatter.Format(
new
PlcAddress(PlcDeviceType.D, 100)));
31
Assert.Equal(
"X10"
, MitsubishiMxDeviceNameFormatter.Format(
new
PlcAddress(PlcDeviceType.X, 16)));
32
Assert.Equal(
"M5.2"
, MitsubishiMxDeviceNameFormatter.Format(
new
PlcAddress(PlcDeviceType.M, 5, 2)));
33
Assert.Equal(
"D101"
, MitsubishiMxDeviceNameFormatter.FormatOffset(
new
PlcAddress(PlcDeviceType.D, 100), 1));
34
}
35
44
[Fact]
45
public
void
OmronCxFormatter_FormatsMappedAreas
()
46
{
47
Assert.Equal(
"D100"
, OmronCxAddressNameFormatter.Format(
new
PlcAddress(PlcDeviceType.D, 100)));
48
Assert.Equal(
"W10"
, OmronCxAddressNameFormatter.Format(
new
PlcAddress(PlcDeviceType.M, 10)));
49
Assert.Equal(
"CIO1.3"
, OmronCxAddressNameFormatter.Format(
new
PlcAddress(PlcDeviceType.X, 1, 3)));
50
Assert.Equal(
"H7"
, OmronCxAddressNameFormatter.FormatOffset(
new
PlcAddress(PlcDeviceType.R, 5), 2));
51
}
52
61
[Fact]
62
public
void
ComponentOptions_ExposeDefaults
()
63
{
64
Assert.False(
string
.IsNullOrWhiteSpace(
new
MitsubishiMxComponentOptions().ProgId));
65
Assert.Equal(
"OMRON.Compolet.CJ2Compolet"
,
new
OmronCxComponentOptions().ProgId);
66
}
67
}
Dreamine.FullKit.Tests.PLC
Definition
ComponentFormatterTests.cs:7
Dreamine.FullKit.Tests.PLC.ComponentFormatterTests
Definition
ComponentFormatterTests.cs:18
Dreamine.FullKit.Tests.PLC.ComponentFormatterTests.ComponentOptions_ExposeDefaults
void ComponentOptions_ExposeDefaults()
Definition
ComponentFormatterTests.cs:62
Dreamine.FullKit.Tests.PLC.ComponentFormatterTests.MitsubishiMxFormatter_FormatsDecimalAndHexDevices
void MitsubishiMxFormatter_FormatsDecimalAndHexDevices()
Definition
ComponentFormatterTests.cs:28
Dreamine.FullKit.Tests.PLC.ComponentFormatterTests.OmronCxFormatter_FormatsMappedAreas
void OmronCxFormatter_FormatsMappedAreas()
Definition
ComponentFormatterTests.cs:45
PLC
ComponentFormatterTests.cs
다음에 의해 생성됨 :
1.17.0