public void BuildWihtoutAnySetup() { var builder = new FluentBehaviourTreeBuilder <int, int>(); Assert.Throws <BehaviourTreeBuilderException>(() => { builder.Build(); }); }
public void Build() { var builder = new FluentBehaviourTreeBuilder <int, int>(); var moqAction = new Mock <IBehaviourTreeNodeSequence <int, int> >(); moqAction.Setup(f => f.Compile()).Returns((time, state) => BehaviourTreeState.Running); builder.Root(moqAction.Object, root => { }); var action = builder.Build(); var compiled = action.Compile(); Assert.NotNull(action); Assert.Equal(BehaviourTreeState.Running, compiled(1, 1)); }