Skip to content

Commit

Permalink
adds optional command and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook committed May 10, 2023
1 parent 0e25195 commit e775456
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 35 deletions.
63 changes: 29 additions & 34 deletions src/source/core/LaunchSequence.spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace tests
protected override function beforeEach()
super.beforeEach()

m.sequence = m.createNodeClass(mc.LaunchSequence)
m.sequence = m.createNodeClass(mc.app.LaunchSequence)
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand All @@ -17,52 +17,47 @@ namespace tests

@it("initializes variables")
function _()
sequence = m.createNodeClass(mc.LaunchSequence)

m.assertEmpty(sequence.poolsByComponentType)
m.assertEqual(sequence.numberOfComponents, 0)
m.assertEqual(sequence.numberOfComponentsInUse, 0)
m.assertEqual(sequence.numberOfComponentsToCreateWhenDry, 10)
m.assertTrue(sequence.isCreateMoreEnabled)
sequence = m.createNodeClass(mc.app.LaunchSequence)
'TODO
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@describe("createIOCInstance")
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@describe("createIOCInstance")
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

@it("creates the required node type and stores it in ioc")
function _()
args = { "id": "args" }
node = mc.createSGNode("Node")
globalNode = mc.createSGNode("Node")
m.sequence.global = globalNode
@it("creates the required node type and stores it in ioc")
function _()
args = { "id": "args" }
node = mc.createSGNode("Node")
globalNode = mc.createSGNode("Node")
m.sequence.global = globalNode

m.expectCalled(m.sequence.createSGNode("Node", invalid, "instanceId", args), node)
m.expectCalled(m.sequence.createSGNode("Node", invalid, "instanceId", args), node)

m.expectCalled(m.sequence.setInstance("instanceId", node))
m.expectCalled(m.sequence.setInstance("instanceId", node))


instance = m.sequence.createIOCInstance("Node", "instanceId", args)
m.assertEqual(instance, node)
m.assertInvalid(globalNode.instanceId)
instance = m.sequence.createIOCInstance("Node", "instanceId", args)
m.assertEqual(instance, node)
m.assertInvalid(globalNode.instanceId)

end function
end function

@it("creates the required node type and stores it in ioc, and stores in global when copyToGlobal is set")
function _()
args = { "id": "args" }
node = mc.createSGNode("Node")
globalNode = mc.createSGNode("Node")
m.sequence.global = globalNode
@it("creates the required node type and stores it in ioc, and stores in global when copyToGlobal is set")
function _()
args = { "id": "args" }
node = mc.createSGNode("Node")
globalNode = mc.createSGNode("Node")
m.sequence.global = globalNode

m.expectCalled(m.sequence.createSGNode("Node", invalid, "instanceId", args), node)
m.expectCalled(m.sequence.createSGNode("Node", invalid, "instanceId", args), node)

m.expectCalled(m.sequence.setInstance("instanceId", node))
m.expectCalled(m.sequence.setInstance("instanceId", node))

m.sequence.createIOCInstance("Node", "instanceId", args, true)
m.sequence.createIOCInstance("Node", "instanceId", args, true)

m.assertEqual(globalNode.instanceId, node)
end function
m.assertEqual(globalNode.instanceId, node)
end function


end class
Expand Down
1 change: 0 additions & 1 deletion src/source/core/app/LaunchSequence.bs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ namespace mc.app
return instance
end function


'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++ Flyweight
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down

0 comments on commit e775456

Please sign in to comment.