public void TestParseAttributePlacement() { Attribute attr = AttributeDeserializer.ParseAttribute("", "(0, 1, 0) (12; 6, 6, 6)"); Attribute attr2 = AttributeDeserializer.ParseAttribute("", "(0, 1, 0) (0x0c; 6, 6, 6)"); Attribute attr3 = AttributeDeserializer.ParseAttribute("", "(0, -1, 0) (0x0c; 6, 6, 6)"); float[] placLoc = new float[] { 0, 1, 0 }; float[] placLoc2 = new float[] { 0, -1, 0 }; float[] placRot = new float[] { 12, 6, 6, 6 }; Assert.AreEqual( new SiiFile.Placement(placLoc, placRot), (SiiFile.Placement)attr.Value ); Assert.AreEqual( new SiiFile.Placement(placLoc, placRot), (SiiFile.Placement)attr2.Value ); Assert.AreEqual( new SiiFile.Placement(placLoc2, placRot), (SiiFile.Placement)attr3.Value ); }
private static void ParseAttributeVectorTestPart(string inputValue, object expectedOutputValue) { Attribute attr = AttributeDeserializer.ParseAttribute("", inputValue); CollectionAssert.AreEqual((ICollection)attr.Value, (ICollection)expectedOutputValue); }
private static void ParseAttributeScalarTestPart(string inputValue, object expectedOutputValue) { Assert.AreEqual(AttributeDeserializer.ParseAttribute("", inputValue).Value, expectedOutputValue); }