teocomi / BCFier

Extensible BCF client and tools
http://bcfier.com/
GNU General Public License v3.0
120 stars 73 forks source link

Fix Guid to IfcGuid conversion #70

Closed tyan closed 5 months ago

tyan commented 5 months ago

Description: A typo in byte conversion causes the conversion to be incorrect for some Guids

This simple test in my BCFier fork fails:

public void test_guid_to_ifc_guid() { // given Guid guid = Guid.Parse("effe4d36-9c2f-8ed1-7115-53ca7505126c");

  // when
  var ifcGuid = IfcGuid.ToIfcGuid(guid);

  // then
  var expectedIfcGuid = new string("3l$aqsd2_EqN4LKyfr1H9i");
  Assert.That(expectedIfcGuid, Is.EqualTo(ifcGuid));
}

Message:  String lengths are both 22. Strings differ at index 8. Expected: "3l$aqsd2wFqN4LKyfr1H9i" But was: "3l$aqsd2_EqN4LKyfr1H9i"