public void ChangesAreAppliedToAsset_TableCollectionName() { var so = new SerializedObject(m_TestFixture); var property = so.FindProperty("tableReference"); var serializedTableEntryReference = new SerializedTableReference(property); serializedTableEntryReference.Reference = "table collection name"; so.ApplyModifiedProperties(); Assert.AreEqual(serializedTableEntryReference.Reference, m_TestFixture.tableReference, "Expected Table Collection Name to be applied to asset when changed through SerializedTableReference."); }
void CheckSerializedTableReferenceMatchesOriginalData() { var so = new SerializedObject(m_TestFixture); var property = so.FindProperty("tableReference"); SerializedTableReference serializedTableReference = new SerializedTableReference(property); Assert.AreEqual(m_TestFixture.tableReference.TableCollectionName, serializedTableReference.Reference.TableCollectionName, "Expected the Table Collection Name to match but it did not. The SerializedTableReference should be able to recreate the TableEntryReference struct via the SerializedProperties."); Assert.AreEqual(m_TestFixture.tableReference.TableCollectionNameGuid, serializedTableReference.Reference.TableCollectionNameGuid, "Expected the Table Collection Name GUID to match but it did not. The SerializedTableReference should be able to recreate the TableEntryReference struct via the SerializedProperties."); Assert.AreEqual(m_TestFixture.tableReference, serializedTableReference.Reference, "Expected references to be equal but they were not. The SerializedTableReference should be able to recreate the TableEntryReference struct via the SerializedProperties."); }
public void ChangesAreAppliedToAsset_EmptyId() { m_TestFixture.tableReference = "table collection name"; // Make it a string name by default var so = new SerializedObject(m_TestFixture); var property = so.FindProperty("tableReference"); var serializedTableEntryReference = new SerializedTableReference(property); // Now clear serializedTableEntryReference.Reference = Guid.Empty; so.ApplyModifiedProperties(); Assert.AreEqual(serializedTableEntryReference.Reference, m_TestFixture.tableReference, "Expected reference to be Empty when changed through SerializedTableReference."); }