Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
#14 Improve readablillity of test
Browse files Browse the repository at this point in the history
  • Loading branch information
baardl committed Aug 25, 2020
1 parent 6297a47 commit f756488
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@ class ObjectIdBuilderTest {
@Test
void build() {
//objectId c40200000b
OctetReader octetReader = new OctetReader("00000b");
ObjectId objectId = new ObjectIdBuilder(Octet.fromHexString("02")).withInstanceNumberOctet(octetReader.nextOctets(3)).build();
OctetReader octetReader = new OctetReader("0200000b");
Octet objectIdType= octetReader.next(); //02
ObjectId objectId = new ObjectIdBuilder(objectIdType).withInstanceNumberOctet(octetReader.nextOctets(3)).build();
assertNotNull(objectId);
assertEquals(ObjectType.AnalogValue, objectId.getObjectType());
assertEquals("11", objectId.getInstanceNumber());
}

@Test
void analogInput0() {
//objectId 1c00000000
OctetReader octetReader = new OctetReader("00000000");
Octet objectIdType= octetReader.next(); //02
ObjectId objectId = new ObjectIdBuilder(objectIdType).withInstanceNumberOctet(octetReader.nextOctets(3)).build();
assertNotNull(objectId);
assertEquals(ObjectType.AnalogInput, objectId.getObjectType());
assertEquals("0", objectId.getInstanceNumber());
}
}

0 comments on commit f756488

Please sign in to comment.