Exemplo n.º 1
0
        public void EventThisWillPayMoney()
        {
            var aspect = AspectFactory.Money();
            var ev     = Event.Create("this_will_pay_money", EventReturnMethod.Or);

            aspect.ReceiveEvent(ev);
            Assert.IsTrue(ev.ReturnValue);
        }
Exemplo n.º 2
0
        public void EventThisCanPayMoney()
        {
            var aspect = AspectFactory.Money();
            var coin   = new Item(_silver);

            coin.AddQuantity(100);

            var ch = new CharacterMockUp();

            ch.Inventory.Add(coin);
            aspect.Host = ch;

            var ev = Event.Create("this_can_pay_money", EventReturnMethod.And, new EventArg("amount", 80));

            aspect.ReceiveEvent(ev);
            Assert.IsTrue(ev.ReturnValue);

            var cantPay = Event.Create("this_can_pay_money", EventReturnMethod.And, new EventArg("amount", 120));

            aspect.ReceiveEvent(cantPay);
            Assert.IsFalse(cantPay.ReturnValue);
        }
Exemplo n.º 3
0
 public void Money()
 {
     Assert.IsNotNull(AspectFactory.Money());
 }