public void TestPropertiesExtractionPass(string propertyPath, string source, object expected) { var property = scriptableObject.FindProperty(propertyPath); ValueExtractionHelper.TryGetValue(source, property, out var actual, out _); Assert.AreEqual(expected, actual); }
public void TestMethodsExtractionPass(string propertyPath, string source, object expected, bool success) { var property = scriptableObject.FindProperty(propertyPath); var isFound = ValueExtractionHelper.TryGetValue(source, property, out var actual, out _); Assert.AreEqual(success, isFound); if (isFound) { Assert.AreEqual(expected, actual); } }
public void TestFieldsExtractionPass(string propertyPath, string source, object expected) { var property = scriptableObject.FindProperty(propertyPath); var sibling = property.GetSibling(source); var fieldInfo = sibling.GetFieldInfo(); sibling.SetProperValue(fieldInfo, expected, false); ValueExtractionHelper.TryGetValue(source, property, out var actual, out var hasMixedValues); Assert.IsFalse(hasMixedValues); Assert.AreEqual(expected, actual); }