[Test] public void GetGameObjects() { DataObject nullData = new DataObject(); DataObject dataIn = new DataObject(); GameObject gameObject = new GameObject(); GameObject[] outParam; dataIn.SetGameObjects(new [] { gameObject }); Assert.IsTrue(dataIn.ContainsGameObjects(DataObjectStorage.Reference)); Assert.IsTrue(dataIn.ContainsGameObjects(DataObjectStorage.Value)); Assert.AreSame(gameObject, dataIn.GetGameObjects(DataObjectStorage.Reference)[0]); Assert.AreNotSame(gameObject, dataIn.GetGameObjects(DataObjectStorage.Value)[0]); Assert.IsFalse(nullData.ContainsGameObjects(DataObjectStorage.Reference)); Assert.IsFalse(nullData.ContainsGameObjects(DataObjectStorage.Value)); Assert.IsTrue(dataIn.TryGetGameObjects(DataObjectStorage.Reference, out outParam)); Assert.IsNotNull(outParam); Assert.IsTrue(dataIn.TryGetGameObjects(DataObjectStorage.Value, out outParam)); Assert.IsNotNull(outParam); Assert.IsFalse(nullData.TryGetGameObjects(DataObjectStorage.Reference, out outParam)); Assert.IsNull(outParam); Assert.IsFalse(nullData.TryGetGameObjects(DataObjectStorage.Value, out outParam)); Assert.IsNull(outParam); DataObject dataOut = this.SimulateClipboardSerialize(dataIn); Assert.IsTrue(dataOut.ContainsGameObjects(DataObjectStorage.Reference)); Assert.IsTrue(dataOut.ContainsGameObjects(DataObjectStorage.Value)); Assert.AreSame(gameObject, dataOut.GetGameObjects(DataObjectStorage.Reference)[0]); Assert.AreNotSame(gameObject, dataOut.GetGameObjects(DataObjectStorage.Value)[0]); Assert.IsTrue(dataOut.TryGetGameObjects(DataObjectStorage.Reference, out outParam)); Assert.IsNotNull(outParam); Assert.IsTrue(dataOut.TryGetGameObjects(DataObjectStorage.Value, out outParam)); Assert.IsNotNull(outParam); }