public void OnCollide(CustomCollider otherCollider)
    {
        CustomBehavior customBehavior = GetComponent <CustomBehavior>();

        if (customBehavior != null)
        {
            customBehavior.OnCollide(otherCollider);
        }
    }
Exemplo n.º 2
0
    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"));
    }
Exemplo n.º 3
0
    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"]);
    }
Exemplo n.º 4
0
 internal Transition(CustomBehavior from, CustomBehavior to)
 {
     this.from = from;
     this.to   = to;
 }
Exemplo n.º 5
0
 // Sets a custom behavior for the politician, one which he does not yet know how to perform
 public void SetCustomBehavior(CustomBehavior behavior)
 {
     CustomBehavior = behavior;
 }
Exemplo n.º 6
0
 // Constructor
 public Politician()
 {
     LieBehavior    = null;
     StealBehavior  = null;
     CustomBehavior = null;
 }
Exemplo n.º 7
0
 public Transition(CustomBehavior from, CustomBehavior to)
 {
     From = from;
     To   = to;
 }