public void OnCollide(CustomCollider otherCollider) { CustomBehavior customBehavior = GetComponent <CustomBehavior>(); if (customBehavior != null) { customBehavior.OnCollide(otherCollider); } }
public async Task ShouldNotAddCustomHeaderToOtherMessageTypes(Type messageType) { var behavior = new CustomBehavior(); var context = new TestableOutgoingLogicalMessageContext { Message = new OutgoingLogicalMessage(messageType, Activator.CreateInstance(messageType)) }; await behavior.Invoke(context, () => Task.CompletedTask); Assert.IsFalse(context.Headers.ContainsKey("custom-header")); }
public async Task ShouldAddCustomHeaderToMyResponse() { var behavior = new CustomBehavior(); var context = new TestableOutgoingLogicalMessageContext { Message = new OutgoingLogicalMessage(typeof(MyResponse), new MyResponse()) }; await behavior.Invoke(context, () => Task.CompletedTask); Assert.AreEqual("custom header value", context.Headers["custom-header"]); }
internal Transition(CustomBehavior from, CustomBehavior to) { this.from = from; this.to = to; }
// Sets a custom behavior for the politician, one which he does not yet know how to perform public void SetCustomBehavior(CustomBehavior behavior) { CustomBehavior = behavior; }
// Constructor public Politician() { LieBehavior = null; StealBehavior = null; CustomBehavior = null; }
public Transition(CustomBehavior from, CustomBehavior to) { From = from; To = to; }