Browse Source

Merge pull request #143 from FungusGames/Test-Call-Method

Added test for Call Method command
master
Chris Gregan 9 years ago
parent
commit
bce0a3b8bc
  1. 101
      Assets/Tests/Scripting/Scripting.unity
  2. 8
      Assets/Tests/Scripting/TestInvoke.cs

101
Assets/Tests/Scripting/Scripting.unity

@ -252,6 +252,80 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
--- !u!1 &842242620
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 842242624}
- 114: {fileID: 842242623}
- 114: {fileID: 842242622}
- 114: {fileID: 842242621}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &842242621
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 842242620}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_AllowActivationOnStandalone: 0
--- !u!114 &842242622
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 842242620}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: .5
m_AllowActivationOnMobileDevice: 0
--- !u!114 &842242623
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 842242620}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &842242624
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 842242620}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!1 &1384749029 --- !u!1 &1384749029
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -333,6 +407,7 @@ GameObject:
- 114: {fileID: 1618689150} - 114: {fileID: 1618689150}
- 114: {fileID: 1618689140} - 114: {fileID: 1618689140}
- 114: {fileID: 1618689151} - 114: {fileID: 1618689151}
- 114: {fileID: 1618689152}
m_Layer: 0 m_Layer: 0
m_Name: Flowchart m_Name: Flowchart
m_TagString: Untagged m_TagString: Untagged
@ -356,7 +431,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1 variablesExpanded: 1
blockViewHeight: 400 blockViewHeight: 437
zoom: 1 zoom: 1
scrollViewRect: scrollViewRect:
serializedVersion: 2 serializedVersion: 2
@ -364,9 +439,9 @@ MonoBehaviour:
y: -351 y: -351
width: 1161 width: 1161
height: 873 height: 873
selectedBlock: {fileID: 1618689147} selectedBlock: {fileID: 1618689131}
selectedCommands: selectedCommands:
- {fileID: 1618689151} - {fileID: 1618689152}
variables: variables:
- {fileID: 1618689138} - {fileID: 1618689138}
- {fileID: 1618689141} - {fileID: 1618689141}
@ -505,6 +580,7 @@ MonoBehaviour:
- {fileID: 1618689142} - {fileID: 1618689142}
- {fileID: 1618689146} - {fileID: 1618689146}
- {fileID: 1618689145} - {fileID: 1618689145}
- {fileID: 1618689152}
- {fileID: 1618689150} - {fileID: 1618689150}
--- !u!114 &1618689132 --- !u!114 &1618689132
MonoBehaviour: MonoBehaviour:
@ -1058,10 +1134,27 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3315ad2ebb85443909a1203d56d9344e, type: 3} m_Script: {fileID: 11500000, guid: 3315ad2ebb85443909a1203d56d9344e, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
itemId: 0 itemId: 16
errorMessage: errorMessage:
indentLevel: 0 indentLevel: 0
duration: 1 duration: 1
--- !u!114 &1618689152
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1618689128}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 17a200dbd67304446a3019434503338a, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 17
errorMessage:
indentLevel: 0
targetObject: {fileID: 1960615183}
methodName: TestCallMethod
delay: 0
--- !u!1 &1960615183 --- !u!1 &1960615183
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

8
Assets/Tests/Scripting/TestInvoke.cs

@ -75,6 +75,12 @@ namespace Fungus
return "a string"; return "a string";
} }
// Test the Call Method command
public void TestCallMethod()
{
passCount++;
}
public void DelayedInvokeEvent() public void DelayedInvokeEvent()
{ {
passCount++; passCount++;
@ -99,7 +105,7 @@ namespace Fungus
} }
// Check the right number of methods were invoked successfully // Check the right number of methods were invoked successfully
if (passCount == 10) if (passCount == 11)
{ {
IntegrationTest.Pass(); IntegrationTest.Pass();
} }

Loading…
Cancel
Save