Пример #1
0
        public void WhenChildIsRunning_ContinueRunning()
        {
            var child = new MockBehaviour {
                ReturnStatus = BehaviourStatus.Running
            };

            var sut = new AutoReset <MockContext>(child);

            sut.Tick(new MockContext());

            Assert.That(child.ResetCount, Is.EqualTo(0));
        }
Пример #2
0
        public void OnTick_ShouldReturnChildStatus(BehaviourStatus status)
        {
            var child = new MockBehaviour {
                ReturnStatus = status
            };

            var sut = new AutoReset <MockContext>(child);

            var behaviourStatus = sut.Tick(new MockContext());

            Assert.That(behaviourStatus, Is.EqualTo(status));
        }
Пример #3
0
        public void WhenChildTerminates_ResetChild(BehaviourStatus status)
        {
            var child = new MockBehaviour {
                ReturnStatus = status
            };

            var sut = new AutoReset <MockContext>(child);

            sut.Tick(new MockContext());

            Assert.That(child.ResetCount, Is.EqualTo(1));
        }