File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ import XCTest
2+ @testable import sACNKit
3+
4+ final class DMPLayerTests : XCTestCase {
5+
6+ /// The test DMP Layer data.
7+ static let testDMPLayerData : Data = DMPLayer . createAsData ( startCode: . perAddressPriority, values: [ 50 ] + Array( repeating: 0 , count: 511 ) )
8+
9+ /// Creates a DMP Layer.
10+ func testCreateDMPLayer( ) throws {
11+ let testLayer = Self . testDMPLayerData
12+ let expectedString = " 720b02a1000000010201dd " + " 32 " + Array( repeating: " 00 " , count: 511 ) . joined ( )
13+
14+ XCTAssertEqual ( testLayer. hexEncodedString ( ) , expectedString)
15+ }
16+
17+ /// Replaces the values in a DMP Layer range.
18+ func testReplaceDMPLayerValuesRange( ) throws {
19+ var testLayer = Self . testDMPLayerData
20+ testLayer. replacingDMPLayerValues ( with: [ 255 , 254 ] + Array( repeating: 0 , count: 510 ) )
21+ let expectedString = " 720b02a1000000010201dd " + " fffe " + Array( repeating: " 00 " , count: 510 ) . joined ( )
22+
23+ XCTAssertEqual ( testLayer. hexEncodedString ( ) , expectedString)
24+ }
25+
26+ }
You can’t perform that action at this time.
0 commit comments