public void TestCanChangeAgentStrategy() { Agent a = new Agent(); a.Update(0f); AIBehaviour subBehaviour = Substitute.For <AIBehaviour>(); subBehaviour.GetName().Returns("AiBehaviourSub"); a.Controller.SetBehaviour(subBehaviour); Assert.AreEqual("AiBehaviourSub", a.Controller.GetBehaviourName()); a.Update(1f); Assert.AreEqual("AiBehaviourSub", a.Controller.GetBehaviourName()); a.Controller.ClearBehaviour(); Assert.AreEqual("AiBehaviourDefault", a.Controller.GetBehaviourName()); }
public string GetBehaviourName() { return(_behaviour.GetName()); }