コード例 #1
0
        public void AddEffect_ExpectedBehavior()
        {
            var task = new PrimitiveTask <byte>()
            {
                Name = "Test"
            };
            var t = task.AddEffect(new ActionEffect <MyContext, byte>("TestEffect", EffectType.Permanent, (context, type) => context.Done = true));

            Assert.IsTrue(t == task);
            Assert.IsTrue(task.Effects.Count == 1);
        }
コード例 #2
0
        public void ApplyEffects_ExpectedBehavior()
        {
            var ctx  = new MyContext();
            var task = new PrimitiveTask <byte>()
            {
                Name = "Test"
            };
            var t = task.AddEffect(new ActionEffect <MyContext, byte>("TestEffect", EffectType.Permanent, (context, type) => context.Done = true));

            task.ApplyEffects(ctx);

            Assert.AreEqual(true, ctx.Done);
        }
コード例 #3
0
    //-----------------------------------------------------------------------------------------------
    private static void ParseEffectForPrimitiveTask(XmlNode effectNode, PrimitiveTask task)
    {
        EffectProperty effect = ParseEffectFromNode(effectNode);

        task.AddEffect(effect);
    }