public RealDuck() { Actions.Add("quack"); ActionMethods.Add(Quack); Actions.Add("fly"); ActionMethods.Add(Fly); }
public ActionManager(GameManager manager) { this.manager = manager; actionsQueue = new ActionsQueue(manager); methods = new ActionMethods(manager, this); }
public void TryCreateDelegate_ClassWithActionMethod_DelegateTypeIsWrong_ReturnsFalse() { var obj = new ActionMethods(); var method = obj.GetType().GetMethod(nameof(obj.SomeAction)); bool canCreate = method.TryCreateDelegate(obj, out Predicate<int> del); Assert.IsFalse(canCreate); }
public void TryCreateDelegate_ClassWithActionMethod_ReturnsTrue() { var obj = new ActionMethods(); var method = obj.GetType().GetMethod(nameof(obj.SomeAction)); bool canCreate = method.TryCreateDelegate(obj, out Action del); Assert.IsTrue(canCreate); }
public RubberDuck() { Actions.Add("squeak"); ActionMethods.Add(Squeak); }