Dreamine.FullKit.Tests 1.0.0.0
Dreamine.FullKit.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
ComponentFormatterTests.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.PLC.Abstractions.Devices;
2using Dreamine.PLC.Mitsubishi.MxComponent.Devices;
3using Dreamine.PLC.Mitsubishi.MxComponent.Options;
4using Dreamine.PLC.Omron.CxComponent.Devices;
5using Dreamine.PLC.Omron.CxComponent.Options;
6
8
17public sealed class ComponentFormatterTests
18{
27 [Fact]
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]
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]
63 {
64 Assert.False(string.IsNullOrWhiteSpace(new MitsubishiMxComponentOptions().ProgId));
65 Assert.Equal("OMRON.Compolet.CJ2Compolet", new OmronCxComponentOptions().ProgId);
66 }
67}