Browse Source

Added test for Save Variable / Load Variable

Added FailTest and PassTest commands
master
chrisgregan 10 years ago
parent
commit
f4654e265d
  1. 2
      Assets/Fungus/Flowchart/Editor/BlockEditor.cs
  2. 9
      Assets/Tests/Commands.meta
  3. 22
      Assets/Tests/Commands/FailTest.cs
  4. 12
      Assets/Tests/Commands/FailTest.cs.meta
  5. 20
      Assets/Tests/Commands/PassTest.cs
  6. 12
      Assets/Tests/Commands/PassTest.cs.meta
  7. 369
      Assets/Tests/Scripting/Scripting.unity

2
Assets/Fungus/Flowchart/Editor/BlockEditor.cs

@ -125,7 +125,7 @@ namespace Fungus
ReorderableListControl.DrawControlFromState(adaptor, null, flags); ReorderableListControl.DrawControlFromState(adaptor, null, flags);
} }
// EventType.contextClick doesn't register since we moved the Sequence Editor to be inside // EventType.contextClick doesn't register since we moved the Block Editor to be inside
// a GUI Area, no idea why. As a workaround we just check for right click instead. // a GUI Area, no idea why. As a workaround we just check for right click instead.
if (Event.current.type == EventType.mouseUp && if (Event.current.type == EventType.mouseUp &&
Event.current.button == 1) Event.current.button == 1)

9
Assets/Tests/Commands.meta

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 142c97e360717444dbacc1b2e07b001d
folderAsset: yes
timeCreated: 1441382833
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

22
Assets/Tests/Commands/FailTest.cs

@ -0,0 +1,22 @@
using UnityEngine;
using System.Collections;
namespace Fungus
{
[CommandInfo("Tests",
"Fail",
"Fails the current integration test")]
public class FailTest : Command
{
public string failMessage;
public override void OnEnter()
{
IntegrationTest.Fail(failMessage);
Continue();
}
}
}

12
Assets/Tests/Commands/FailTest.cs.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2dcb71131f45b47fead560a97ef55f1c
timeCreated: 1441382828
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

20
Assets/Tests/Commands/PassTest.cs

@ -0,0 +1,20 @@
using UnityEngine;
using System.Collections;
namespace Fungus
{
[CommandInfo("Tests",
"Pass",
"Passes the current integration test")]
public class PassTest : Command
{
public override void OnEnter()
{
IntegrationTest.Pass();
Continue();
}
}
}

12
Assets/Tests/Commands/PassTest.cs.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4920f47cde1a84b11ad07b7317568494
timeCreated: 1441383087
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

369
Assets/Tests/Scripting/Scripting.unity

@ -126,7 +126,317 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 3
--- !u!1 &396492925
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 396492935}
- 114: {fileID: 396492926}
- 114: {fileID: 396492930}
- 114: {fileID: 396492933}
- 114: {fileID: 396492928}
- 114: {fileID: 396492932}
- 114: {fileID: 396492929}
- 114: {fileID: 396492931}
- 114: {fileID: 396492927}
- 114: {fileID: 396492936}
- 114: {fileID: 396492934}
- 114: {fileID: 396492939}
- 114: {fileID: 396492938}
- 114: {fileID: 396492937}
- 114: {fileID: 396492940}
m_Layer: 0
m_Name: Flowchart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &396492926
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 1.0
scrollPos: {x: 0, y: 0}
variablesScrollPos: {x: 0, y: 0}
variablesExpanded: 1
blockViewHeight: 400
zoom: 1
scrollViewRect:
serializedVersion: 2
x: -343
y: -340
width: 1114
height: 892
selectedBlock: {fileID: 396492930}
selectedCommands:
- {fileID: 396492940}
variables:
- {fileID: 396492928}
- {fileID: 396492927}
description:
stepPause: 0
colorCommands: 1
hideComponents: 1
saveSelection: 1
localizationId:
--- !u!114 &396492927
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3}
m_Name:
m_EditorClassIdentifier:
scope: 0
key: OtherString
value:
--- !u!114 &396492928
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3}
m_Name:
m_EditorClassIdentifier:
scope: 0
key: TestString
value:
--- !u!114 &396492929
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 23c657364a3b24e16bdf5946729a8b7b, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 2
errorMessage:
indentLevel: 0
key: TestStringKey
variable: {fileID: 396492927}
--- !u!114 &396492930
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 209
y: 111
width: 120
height: 40
itemId: 0
blockName: Start
description:
eventHandler: {fileID: 396492933}
commandList:
- {fileID: 396492936}
- {fileID: 396492932}
- {fileID: 396492931}
- {fileID: 396492929}
- {fileID: 396492939}
- {fileID: 396492937}
- {fileID: 396492938}
- {fileID: 396492934}
- {fileID: 396492940}
--- !u!114 &396492931
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1bef7966140464bd5a3ef4da2ff236b9, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 3
errorMessage:
indentLevel: 0
key: TestStringKey
variable: {fileID: 396492928}
--- !u!114 &396492932
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fb77d0ce495044f6e9feb91b31798e8c, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 1
errorMessage:
indentLevel: 0
variable: {fileID: 396492928}
setOperator: 0
booleanData:
booleanRef: {fileID: 0}
booleanVal: 0
integerData:
integerRef: {fileID: 0}
integerVal: 0
floatData:
floatRef: {fileID: 0}
floatVal: 0
stringData:
stringRef: {fileID: 0}
stringVal: SomeValue
--- !u!114 &396492933
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3}
m_Name:
m_EditorClassIdentifier:
parentBlock: {fileID: 396492930}
--- !u!114 &396492934
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1205d6641f2146b19d496037f937ba0, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 5
errorMessage:
indentLevel: 0
key: TestString
--- !u!4 &396492935
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
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: 911947602}
m_RootOrder: 0
--- !u!114 &396492936
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e1205d6641f2146b19d496037f937ba0, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 4
errorMessage:
indentLevel: 0
key: TestString
--- !u!114 &396492937
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2dcb71131f45b47fead560a97ef55f1c, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 8
errorMessage:
indentLevel: 1
failMessage: Wrong string value
--- !u!114 &396492938
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93cb9773f2ca04e2bbf7a68ccfc23267, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 7
errorMessage:
indentLevel: 0
--- !u!114 &396492939
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70c5622b8a80845c980954170295f292, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 6
errorMessage:
indentLevel: 0
compareOperator: 1
variable: {fileID: 396492927}
booleanData:
booleanRef: {fileID: 0}
booleanVal: 0
integerData:
integerRef: {fileID: 0}
integerVal: 0
floatData:
floatRef: {fileID: 0}
floatVal: 0
stringData:
stringRef: {fileID: 0}
stringVal: SomeValue
--- !u!114 &396492940
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 396492925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4920f47cde1a84b11ad07b7317568494, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 9
errorMessage:
indentLevel: 0
--- !u!1 &646902073 --- !u!1 &646902073
GameObject: GameObject:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -154,7 +464,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
selectedFlowchart: {fileID: 1618689129} selectedFlowchart: {fileID: 396492926}
--- !u!4 &646902075 --- !u!4 &646902075
Transform: Transform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -235,6 +545,7 @@ Camera:
m_RenderingPath: -1 m_RenderingPath: -1
m_TargetTexture: {fileID: 0} m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0 m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0 m_HDR: 0
m_OcclusionCulling: 1 m_OcclusionCulling: 1
m_StereoConvergence: 10 m_StereoConvergence: 10
@ -325,7 +636,57 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3 m_RootOrder: 4
--- !u!1 &911947601
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 911947602}
- 114: {fileID: 911947603}
m_Layer: 0
m_Name: SaveLoadTest
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &911947602
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 911947601}
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:
- {fileID: 396492935}
m_Father: {fileID: 0}
m_RootOrder: 2
--- !u!114 &911947603
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 911947601}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3}
m_Name:
m_EditorClassIdentifier:
timeout: 5
ignored: 0
succeedAfterAllAssertionsAreExecuted: 0
expectException: 0
expectedExceptionList:
succeedWhenExceptionIsThrown: 0
includedPlatforms: -1
platformsToIgnore: []
dynamic: 0
dynamicTypeName:
--- !u!1 &1384749029 --- !u!1 &1384749029
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -336,7 +697,7 @@ GameObject:
- 4: {fileID: 1384749030} - 4: {fileID: 1384749030}
- 114: {fileID: 1384749031} - 114: {fileID: 1384749031}
m_Layer: 0 m_Layer: 0
m_Name: TestInvoke m_Name: InvokeTest
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0

Loading…
Cancel
Save