Пример #1
0
        public void NoTicks(NodeStatus expectedStatus)
        {
            var node = new ReturnXNode(expectedStatus);

            Assert.That(node.Ticks, Is.EqualTo(0));
            Assert.That(node.Halts, Is.EqualTo(0));
        }
Пример #2
0
        public void ReturnsExpectedOnce(NodeStatus expectedStatus)
        {
            var node         = new ReturnXNode(expectedStatus);
            var actualStatus = node.Tick();

            Assert.That(actualStatus, Is.EqualTo(expectedStatus));
            Assert.That(node.Ticks, Is.EqualTo(1));
        }
Пример #3
0
        public void HaltCounter(int expectedHalts)
        {
            var node = new ReturnXNode(NodeStatus.SUCCESS);

            for (int i = 0; i < expectedHalts; i++)
            {
                node.Halt();
            }

            Assert.That(node.Halts, Is.EqualTo(expectedHalts));
        }
Пример #4
0
        public void ReturnsExpectedNTimes(NodeStatus expectedStatus, int expectedTicks)
        {
            var node = new ReturnXNode(expectedStatus);

            for (int i = 0; i < expectedTicks; i++)
            {
                var actualStatus = node.Tick();
                Assert.That(actualStatus, Is.EqualTo(expectedStatus));
            }

            Assert.That(node.Ticks, Is.EqualTo(expectedTicks));
        }